From 6a01d5b71416bf7dbbc9f789c84613830977e058 Mon Sep 17 00:00:00 2001 From: Phi Hung Le Date: Tue, 19 Dec 2023 23:38:12 +0000 Subject: [PATCH] Format files. --- src/main/cc/any_sketch/crypto/secret_share_generator.cc | 1 + src/main/cc/math/open_ssl_uniform_random_generator.cc | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/cc/any_sketch/crypto/secret_share_generator.cc b/src/main/cc/any_sketch/crypto/secret_share_generator.cc index 2451117..95be052 100644 --- a/src/main/cc/any_sketch/crypto/secret_share_generator.cc +++ b/src/main/cc/any_sketch/crypto/secret_share_generator.cc @@ -14,6 +14,7 @@ #include "any_sketch/crypto/secret_share_generator.h" +#include #include #include "absl/status/status.h" diff --git a/src/main/cc/math/open_ssl_uniform_random_generator.cc b/src/main/cc/math/open_ssl_uniform_random_generator.cc index 645dc73..e09ad4c 100644 --- a/src/main/cc/math/open_ssl_uniform_random_generator.cc +++ b/src/main/cc/math/open_ssl_uniform_random_generator.cc @@ -123,9 +123,8 @@ OpenSslUniformPseudorandomGenerator::GenerateUniformRandomRange( // To get current_size `good` elements, it is expected to sample // 1 + current_size*(1 + failure_rate/(1-failure_rate)) elements in // [0, 2^{bit_length}). - uint64_t sample_size = - (uint64_t)(current_size + 1 + - failure_rate * current_size / (1 - failure_rate)); + uint64_t sample_size = static_cast( + current_size + 1.0 + failure_rate * current_size / (1 - failure_rate)); ASSIGN_OR_RETURN(std::vector arr, GeneratePseudorandomBytes(sample_size * bytes_per_value));