From f7443672b7c87967217cfba80635fa25878997c9 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 12 Apr 2023 15:30:24 -0400 Subject: [PATCH 1/3] Update field.hpp --- cpp/src/barretenberg/ecc/fields/field.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/src/barretenberg/ecc/fields/field.hpp b/cpp/src/barretenberg/ecc/fields/field.hpp index 66c59ea0d2..7950a1ffea 100644 --- a/cpp/src/barretenberg/ecc/fields/field.hpp +++ b/cpp/src/barretenberg/ecc/fields/field.hpp @@ -25,6 +25,9 @@ namespace barretenberg { template struct alignas(32) field { public: // We don't initialize data by default since we'd lose a lot of time on pointless initializations. + // Other alternatives have been noted, such as casting to get around constructors where they matter, + // however it is felt that sanitizer tools (e.g. MSAN) can detect garbage well, whereas not doing + // hacky casts where needed would require rework to critical algos like MSM, FFT, Sumcheck. field() noexcept {} constexpr field(const uint256_t& input) noexcept From 381ce7e74dd0926b8ef2c0c8966e94a1cc22ab1e Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 12 Apr 2023 15:31:47 -0400 Subject: [PATCH 2/3] Update field.hpp --- cpp/src/barretenberg/ecc/fields/field.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/src/barretenberg/ecc/fields/field.hpp b/cpp/src/barretenberg/ecc/fields/field.hpp index 7950a1ffea..d60686c49e 100644 --- a/cpp/src/barretenberg/ecc/fields/field.hpp +++ b/cpp/src/barretenberg/ecc/fields/field.hpp @@ -28,6 +28,7 @@ template struct alignas(32) field { // Other alternatives have been noted, such as casting to get around constructors where they matter, // however it is felt that sanitizer tools (e.g. MSAN) can detect garbage well, whereas not doing // hacky casts where needed would require rework to critical algos like MSM, FFT, Sumcheck. + // Instead, the recommended solution is use an explicit = 0 where initialization is important. field() noexcept {} constexpr field(const uint256_t& input) noexcept From 62abab8dd4a11921dfa7d5ebc40b3232f615b4e4 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 12 Apr 2023 15:32:40 -0400 Subject: [PATCH 3/3] Update field.hpp --- cpp/src/barretenberg/ecc/fields/field.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/barretenberg/ecc/fields/field.hpp b/cpp/src/barretenberg/ecc/fields/field.hpp index d60686c49e..80a87f46af 100644 --- a/cpp/src/barretenberg/ecc/fields/field.hpp +++ b/cpp/src/barretenberg/ecc/fields/field.hpp @@ -26,7 +26,7 @@ template struct alignas(32) field { public: // We don't initialize data by default since we'd lose a lot of time on pointless initializations. // Other alternatives have been noted, such as casting to get around constructors where they matter, - // however it is felt that sanitizer tools (e.g. MSAN) can detect garbage well, whereas not doing + // however it is felt that sanitizer tools (e.g. MSAN) can detect garbage well, whereas doing // hacky casts where needed would require rework to critical algos like MSM, FFT, Sumcheck. // Instead, the recommended solution is use an explicit = 0 where initialization is important. field() noexcept {}