"Fossies" - the Fresh Open Source Software Archive

Member "qt-everywhere-src-6.3.1/qtwebengine/src/3rdparty/chromium/third_party/shell-encryption/patches/0001-Support-SHELL-in-chromium.patch" (8 Jun 2022, 4284 Bytes) of package /linux/misc/qt-everywhere-src-6.3.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 diff --git a/montgomery.cc b/montgomery.cc
    2 index d5221f4..9fbc5da 100644
    3 --- a/montgomery.cc
    4 +++ b/montgomery.cc
    5 @@ -22,8 +22,8 @@ template <typename T>
    6  rlwe::StatusOr<std::unique_ptr<const MontgomeryIntParams<T>>>
    7  MontgomeryIntParams<T>::Create(Int modulus) {
    8    // Check that the modulus is smaller than max(Int) / 4.
    9 -  if (Int most_significant_bit = modulus >> (bitsize_int - 2);
   10 -      most_significant_bit != 0) {
   11 +  Int most_significant_bit = modulus >> (bitsize_int - 2);
   12 +  if (most_significant_bit != 0) {
   13      return absl::InvalidArgumentError(absl::StrCat(
   14          "The modulus should be less than 2^", (bitsize_int - 2), "."));
   15    }
   16 diff --git a/ntt_parameters.h b/ntt_parameters.h
   17 index 56e1871..c3da197 100644
   18 --- a/ntt_parameters.h
   19 +++ b/ntt_parameters.h
   20 @@ -103,7 +103,8 @@ static void BitrevHelper(const std::vector<unsigned int>& bitrevs,
   21    using std::swap;
   22    for (int i = 0; i < item_to_reverse->size(); i++) {
   23      // Only swap in one direction - don't accidentally swap twice.
   24 -    if (unsigned int r = bitrevs[i]; i < r) {
   25 +    unsigned int r = bitrevs[i];
   26 +    if (static_cast<unsigned int>(i) < r) {
   27        swap((*item_to_reverse)[i], (*item_to_reverse)[r]);
   28      }
   29    }
   30 diff --git a/polynomial.h b/polynomial.h
   31 index 07843b2..3cf0c77 100644
   32 --- a/polynomial.h
   33 +++ b/polynomial.h
   34 @@ -80,7 +80,8 @@ class Polynomial {
   35                                   const NttParameters<ModularInt>* ntt_params,
   36                                   const ModularIntParams* modular_params) {
   37      // Check to ensure that the coefficient vector is of the correct length.
   38 -    if (int len = poly_coeffs.size(); len <= 0 || (len & (len - 1)) != 0) {
   39 +    int len = poly_coeffs.size();
   40 +    if (len <= 0 || (len & (len - 1)) != 0) {
   41        // An error value.
   42        return Polynomial();
   43      }
   44 diff --git a/prng/chacha_prng_util.cc b/prng/chacha_prng_util.cc
   45 index dfab1d9..c49c82d 100644
   46 --- a/prng/chacha_prng_util.cc
   47 +++ b/prng/chacha_prng_util.cc
   48 @@ -24,7 +24,8 @@
   49  #include <openssl/rand.h>
   50  #include "status_macros.h"
   51  
   52 -namespace rlwe::internal {
   53 +namespace rlwe {
   54 +namespace internal {
   55  
   56  absl::Status ChaChaPrngResalt(absl::string_view key, int buffer_size,
   57                                int* salt_counter, int* position_in_buffer,
   58 @@ -85,4 +86,5 @@ rlwe::StatusOr<Uint64> ChaChaPrngRand64(absl::string_view key,
   59    return rand64;
   60  }
   61  
   62 -}  // namespace rlwe::internal
   63 +}  // namespace internal
   64 +}  // namespace rlwe
   65 diff --git a/prng/chacha_prng_util.h b/prng/chacha_prng_util.h
   66 index 32cac5b..8eb8118 100644
   67 --- a/prng/chacha_prng_util.h
   68 +++ b/prng/chacha_prng_util.h
   69 @@ -28,7 +28,8 @@
   70  #include "integral_types.h"
   71  #include "statusor.h"
   72  
   73 -namespace rlwe::internal {
   74 +namespace rlwe {
   75 +namespace internal {
   76  
   77  const int kChaChaKeyBytesSize = 32;
   78  const int kChaChaNonceSize = 12;
   79 @@ -59,6 +60,7 @@ rlwe::StatusOr<Uint64> ChaChaPrngRand64(absl::string_view key,
   80                                          int* salt_counter,
   81                                          std::vector<Uint8>* buffer);
   82  
   83 -}  // namespace rlwe::internal
   84 +}  // namespace internal
   85 +}  // namespace rlwe
   86  
   87  #endif  // RLWE_CHACHA_PRNG_UTIL_H_
   88 diff --git a/statusor.h b/statusor.h
   89 index d8addb5..200f62d 100644
   90 --- a/statusor.h
   91 +++ b/statusor.h
   92 @@ -96,7 +96,7 @@ class StatusOr {
   93  
   94    operator absl::Status() const { return status(); }
   95  
   96 -  template <template <typename> typename OtherStatusOrType>
   97 +  template <template <typename> class OtherStatusOrType>
   98    operator OtherStatusOrType<T>() {
   99      if (value_) {
  100        return OtherStatusOrType<T>(std::move(value_.value()));
  101 diff --git a/symmetric_encryption.h b/symmetric_encryption.h
  102 index e120b18..987e86f 100644
  103 --- a/symmetric_encryption.h
  104 +++ b/symmetric_encryption.h
  105 @@ -571,8 +571,8 @@ class SymmetricRlweKey {
  106        const typename ModularIntQ::Params* modulus_params_q,
  107        const NttParameters<ModularIntQ>* ntt_params_q) const {
  108      // Configuration failure.
  109 -    if (Int t = (modulus_params_q->One() << log_t_) + modulus_params_q->One();
  110 -        modulus_params_->modulus % t != modulus_params_q->modulus % t) {
  111 +    Int t = (modulus_params_q->One() << log_t_) + modulus_params_q->One();
  112 +    if (modulus_params_->modulus % t != modulus_params_q->modulus % t) {
  113        return absl::InvalidArgumentError("p % t != q % t");
  114      }
  115