From ce31d094f87143ee1c89aa5c2f347c78233eebb2 Mon Sep 17 00:00:00 2001 From: desilo-hanyul <95674196+hanyul-ryu@users.noreply.github.com> Date: Tue, 12 Dec 2023 15:59:46 +0900 Subject: [PATCH 1/2] Update rns_partition.py Dead code removal request --- src/liberate/ntt/rns_partition.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/liberate/ntt/rns_partition.py b/src/liberate/ntt/rns_partition.py index b2cedcf..276afa9 100644 --- a/src/liberate/ntt/rns_partition.py +++ b/src/liberate/ntt/rns_partition.py @@ -56,12 +56,6 @@ def __init__( self.num_scales = self.num_ordinary_primes - 1 self.base_prime_idx = self.num_ordinary_primes - 1 - self.special_prime_idx = list( - range( - self.num_ordinary_primes + 1, - self.num_ordinary_primes + 1 + self.num_special_primes, - ) - ) self.compute_destination_arrays() self.compute_rescaler_locations() From 8df4f39fe011d66fcfbbe814b0efa89ed2fa39b3 Mon Sep 17 00:00:00 2001 From: desilo-hanyul <95674196+hanyul-ryu@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:01:30 +0900 Subject: [PATCH 2/2] Update csprng.py Rationalized length calculation. --- src/liberate/csprng/csprng.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/liberate/csprng/csprng.py b/src/liberate/csprng/csprng.py index 8de672a..b7d41a7 100644 --- a/src/liberate/csprng/csprng.py +++ b/src/liberate/csprng/csprng.py @@ -230,7 +230,7 @@ def randbytes(self, shares=None, repeats=0, length=None, reshape=False): if length is None: L = self.L else: - L = length + L = length // 16 # Set the target states. target_states = [] @@ -261,7 +261,7 @@ def randint(self, amax=3, shift=0, repeats=0, length=None): if length is None: L = self.L else: - L = length + L = length // 4 # Calculate shares. # If repeats are greater than 0, those channels are @@ -298,7 +298,7 @@ def discrete_gaussian(self, non_repeats=0, repeats=1, length=None): if length is None: L = self.L else: - L = length + L = length // 4 # Set the target states. target_states = []