Next Article in Journal
Hexatetra-Carbon: A Novel Two-Dimensional Semiconductor Allotrope of Carbon
Next Article in Special Issue
Develop Control Architectures to Enhance Soft Actuator Motion and Force
Previous Article in Journal
A Numerical Approach for Developing a Bearing-Bypass Design Criterion for Sizing Bolted Joints
Previous Article in Special Issue
Improved Modular Division Implementation with the Akushsky Core Function
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Efficient Method for Comparing Numbers and Determining the Sign of a Number in RNS for Even Ranges

by
Andrei Tchernykh
1,2,3,*,
Mikhail Babenko
2,4,
Egor Shiriaev
5,
Bernardo Pulido-Gaytan
1,
Jorge M. Cortés-Mendoza
3,
Arutyun Avetisyan
2,
Alexander Yu Drozdov
6 and
Viktor Kuchukov
5
1
Computer Science Department, CICESE Research Center, Ensenada 22860, Mexico
2
Control/Management and Applied Mathematics, Institute for System Programming of the Russian Academy of Sciences, 109004 Moscow, Russia
3
School of Electronic Engineering and Computer Science, South Ural State University, 454080 Chelyabinsk, Russia
4
North-Caucasus Center for Mathematical Research, North-Caucasus Federal University, 355017 Stavropol, Russia
5
Department of Applied Mathematics and Mathematical Modeling, North-Caucasus Federal University, 355017 Stavropol, Russia
6
School of Radio Engineering and Computer Technology, Moscow Institute of Physics and Technology, 141701 Moscow, Russia
*
Author to whom correspondence should be addressed.
Computation 2022, 10(2), 17; https://doi.org/10.3390/computation10020017
Submission received: 20 December 2021 / Revised: 14 January 2022 / Accepted: 19 January 2022 / Published: 24 January 2022

Abstract

:
Fully Homomorphic Encryption (FHE) permits processing information in the form of ciphertexts without decryption. It can ensure the security of information in common technologies used today, such as cloud computing, the Internet of Things, and machine learning, among others. A primary disadvantage for its practical application is the low efficiency of sign and comparison operations. Several FHE schemes use the Residue Number System (RNS) to decrease the time complexity of these operations. Converting from the RNS to the positional number system and calculating the positional characteristic of a number are standard approaches for both operations in the RNS domain. In this paper, we propose a new method for comparing numbers and determining the sign of a number in RNS. We focus on the even ranges that are computationally simple due to their peculiarities. We compare the performance of several state-of-art algorithms based on an implementation in C++ and relatively simple moduli with a bit depth from 24 to 64 bits. The experimental analysis shows a better performance of our approach for all the test cases; it improves the sign detection between 1.93 and 15.3 times and the number comparison within 1.55–11.35 times with respect to all the methods and configurations.

1. Introduction

Number comparison and sign detection are simple and basic operations for calculation in computing systems. Both operations are necessary for almost any application area in computing technology: mathematical calculations, rendering, data storage, data transfer, data retrieval, encryption, machine learning, etc. Unfortunately, their application for encrypted data exhibits several limitations.
Sign detection and comparison of numbers in the Residue Number System (RNS) are based on the calculation of the positional characteristic. The algorithms for both operations in RNS are computationally complex because RNS is not a Weighted Number System (WNS). Various methods are used to reduce their computational complexity, such as the Pirlo and Impedovo function [1], Diagonal Function (DF) [2,3], Modified Diagonal Function (MDF) [4], Approximate Method (AM) [5,6], and Core Function (CF) [7].
Both operations are fundamental for the applicability of RNS for both hardware and software implementations. Reducing their computational complexity expands the scope of RNS for solving problems of computational mathematics and mathematical modeling. For instance, the use of RNS in software implementation on the GPU increases the performance of matrix processing [8,9]. Moreover, RNS is a main direction in the implementation of Homomorphic Encryption (HE) software.
Fully HE (FHE) has gained popularity for its applicability in cryptosystems [10]. Performing simple arithmetic operations (homomorphic addition and multiplication) over ciphertexts is its main feature. Hence, the processing of encrypted information does not require its preliminary decryption. This characteristic increases the confidentiality and reliability of the data processing [11,12], for example, in third-party systems such as cloud computing [13,14].
However, comparing ciphertext information is a laborious and computationally complex task [15,16]. Cheon–Kim–Kim–Song (CKKS) [17] and Brakerski/Fan–Vercauteren (BFV) [18] are FHE schemes that use RNS to increase the efficiency of sign detection and numbers’ comparison [4,6,19,20,21].
The comparison operation can be performed in a relatively simple way: subtract one number from another, and if the result of the operation is negative, then the first number is greater than the second one and vice versa. Many methods in RNS work using this property. However, they are often ineffective, since they apply division by large numbers or use computationally complex algorithms to calculate the positional characteristic of the number.
In this paper, we consider a new algorithm for determining the sign of numbers in an even range with RNS. The content of the paper is structured as follows. Section 2 briefly introduces the residue number system. Section 3 describes several methods to determine the sing of numbers in RNS. The performance evaluation is described in Section 4. Finally, we conclude and discuss future works in Section 5.

2. Residue Number System

RNS is a not WNS based on Chinese Remainder Theorem (CRT) [22,23]. It is defined by a vector of coprime numbers called moduli. This vector, also called the RNS basis, can be denoted as ( p 1 , p 2 ,   ,   p n ) . The basis is determined by the product of all the p i elements: P = i = 1 n p i , where n is the length of the moduli vector. A positional number X is represented in RNS by the residues ( x 1 , x 2 , , x n ) , where
x 1 X ( m o d   p 1 ) ,
x 2 X ( m o d   p 2 ) ,
x n X ( m o d   p n ) .
A restriction is imposed on the number X such that X [ 0 ,   P 1 ] ; otherwise, the residue of the number X will be obtained from the number X , where X = X P . Additionally, the CRT corollary guarantees the uniqueness of the representation of non-negative integers within the interval [ 0 ,   P 1 ] . The representation of negative numbers in RNS considers the radix addition, where X is represented as X = P X . This property is used to determine the sign of a number based on converting a number from RNS to WNS, i.e., decimal, binary, etc.
The simplicity to perform basic arithmetic operations is the main advantage of RNS for computing. Addition, multiplication, and subtraction operations are performed according to the following general formula:
A B = ( a 1 , a 2 , , a n ) ( b 1 , b 2 , , b n ) = ( ( a 1 b 1 ) m o d   p 1 ) , ,   ( ( a n b n ) m o d   p n ) ,
where ∗ denotes operations such as addition, multiplication, and subtraction.
The modular arithmetic, or operations in RNS, has several particularities: the value of the number in each residue does not depend on other residues, and one cycle of the processor’s numerical processing is enough to perform such operations, since this processing can be performed in parallel.
Let us prove that the ranges of numbers in RNS and WNS are equal. For example, for moduli RNS p 1 = 3 , p 2 = 5 , p 3 = 17 , p 4 = 257 , and p 5 = 65537 , the RNS range is P = i = 1 5 p i = 2 32 1 and WNS range is 2 32 1 .
Let RNS be given by the basis ( p 1 , p 2 , , p n ) and the number with residues X = ( x 1 , x 2 , , x n ) . Then, the number X can be represented in the form.
X = ( y n · p 1 · p 2 · · p n 1 + y n 1 · p 1 · p 2 · · p n 2 + + y 3 · p 1 · p 2 + y 2 · p 1 + y 1 ) , where y i is from 0 to p k , and 0 x k < p 1 · p 2 · · p k 1 ( k = 1 , , n ) are the coefficients of RNS.
The ranges of numbers represented in RNS and WNS coincide; i.e., we can talk about the presence of a one-to-one correspondence between the set of number representations in RNS and WNS.
The previous equality can be rewritten as:
X = y 1 + p 1 ( y 2 + p 2 ( y 3 + + p n 2 ( y n 1 + p n 1 y n ) ) ) ,
thereby translating numbers into WNS. It establishes the basic concepts of RNS, operations, and translating numbers from WNS to RNS and vice versa.

3. Methods for Determining the Sign of a Number in RNS

3.1. Chinese Remainder Theorem

The following formula is used to convert numbers from RNS to WNS with Chinese Remainder Theorem (CRT)
X = | i = 0 n P i · x i · | P i 1 | p i | P
where P i = P p i and | P i 1 | p i is a multiplicative inverse of P i modulo p i .
The restored number must be compared with P / 2 . If X < P / 2 , then the number is greater than zero. Two’s complement is the most common method of representing signed integers. Its half of the range (the upper half) denotes a negative number and vice versa. To estimate the time complexity, we assume that all RNS moduli are composed of l -bits bit words, so the time complexity is defined by O ( n 2 · l 2 ) .
Let us consider an example based on this method.
Example 1.
Let the number X be represented in RNS with moduli ( 3 ,   5 ,   7 ) and residues ( 2 ,   2 ,   3 ) . Initially, we calculate the dynamic range P = 3 5 7 = 105 and the P i elements:
P 1 = P p 1 = 105 3 = 35 ,  
P 2 = P p 2 = 105 5 = 21 ,  
P 3 = P p 3 = 105 7 = 15 .
Then, we compute the multiplicative inverse, which consists in finding P i 1 , such that P i 1 · P i 1   m o d   p i . Therefore,
| P 1 1 | 3 = 2 ,  
| P 2 1 | 5 = 1 ,  
| P 3 1 | 7 = 1 .
Next, we use Formula (2) to calculate the value of X :
X = | 35 · 2 · 2 + 21 · 2 · 1 + 15 · 3 · 1 | 105 = | 227 | 105 = 17
Finally, we compare X with P / 2 ; then, 17 < 105 2 or 17 < 52.5 . Therefore, the number is positive.
Algorithm 1 presents the pseudocode of the CRT method.
Algorithm 1: CRT Method.
Input: P ,   ( x 1 , x 2 , , x n ) ,   ( p 1 , p 2 , , p n ) ,   and   ( P 1 , P 2 , , P n )
Output:   S
1 .   s u m = 0
2 .   for   i = 1 to   n  do:
2.1   s u m + = x i | P i 1 | p i P i
3 .   X = s u m   mod   P
4 .   if   X < P / 2 :
4.1 S = 1
5. else:
5.1   S = 0
However, this method has a significant drawback due to the divisions to obtain X . The division of large numbers by a large P increases the time required for calculations.

3.2. Mixed Radix Conversion Method

The Mixed Radix Conversion (MRC) method consists of a consecutive translation of a number from RNS to WNS. In addition, a pattern in the number in a generalized form is traced by y i = ( U i · V i ) ρ i , where U i is known as the conversion coefficient and defines an increasing series
U 1 = x 1 ,
U 2 = | x 2 x 1 | p 1 ,
  U 3 = | x 3 x 2 x 1 U 2 | p 1 .
Yassin and Moore [24] found that
V 1 = 1 ,
V 2 = | 1 p 1 | p 2 = 1 ,
V 3 = | 1 p 1 p 2 | p 3 = 1 .
Example 2.
The initial data are a set of moduli ( 127 ,   63 ,   50 ,   13 ) , a set of residues ( 78 ,   41 ,   47 ,   7 ) , V 1 = 1 ,   V 2 = 1 ,   V 3 = 1 , and V 4 = 1 .
First, we find the y i coefficients:
y 1 = U 1 · V 1 = 78 ,
y 2 = U 2 · V 2 = | 41 78 | 63 · 1 = 26 ,
y 3 = U 3 · V 3 = | 47 78 127 · 26 | 50 · 1 = 17 ,
y 4 = U 4 · V 4 = | 7 78 127 · 26 127 · 63 · 17 | 13 · 1 = 9 .
Second, the number is restored by (2)
X = 78 + 26 · 127 + 17 · 127 · 63 + 9 · 127 · 633 · 50 = 3,739,847 .
Finally, we compare X with P / 2 ; then, 3,739,847 < 5,200,650 . Therefore, the number is positive. Time complexity is O ( n 2 · l 2 ) .
Algorithm 2 describes the pseudocode of the MRC method.
Algorithm 2: MRC Method.
Input: ( x 1 , x 2 , , x n ) and ( p 1 , p 2 , , p n )
Output:   S
1. U 1 = x 1 , k 1 = 0 , h = 1 , and P = 1
2. for  i = 2  to  n  do
2.1 h   = n i 1
2.2 U i = ( x i x 1 k i 1 )   m o d   p i
2.3 k i = U i h k i 1
3. s u m + = U i   m o d   p i
4. for  i = 1  to  n  do
4.1 P = p i
4.2 s u m + = P ( U i )   m o d   p i
5 X = s u m
6 if   X < P / 2 :
6.1 S = 1
7. else:
7.1     S = 0
Effective implementation of this method allows avoiding division by a large P . However, the method uses many modular operations related to the vector ( p 1 ,   p 2 ,   , p n ) .

3.3. Approximate Method

The algorithm for finding the Euclidean division by the range RNS is computationally complex. To reduce the computational complexity of the Approximate Method (AM), it is proposed to use weighted coefficients, which allow replacing the operation of Euclidean division with the operation of taking a fractional part.
AM is based on the mapping from [ 0 , P 1 ] to [ 0 , 2 ) to avoid the division by a large P .
The mapping allows calculating the positional characteristic of the number, hence, to determine the sign of the number or compare numbers with each other. The positional characteristic is originally calculated as:
V ( X ) = | i = 1 n ( 2 p i | | P i 1 | p i · x i | ) 2 N | 2 .
However, the use of (3) as a positional characteristic requires the use of rational fractions or their approximation using numbers with a fixed precision, which increases the computational complexity of the algorithm. In [25], a modification of the methods from [5] was proposed, which allows retaining the advantages of the method from [5] but at the same time avoiding the use of rational numbers.
V C ( X ) = | i = 1 n W i · x i | 2 N ,
where W i = 2 N | P i 1 | p i / p i , with N = log 2 ( P ρ ) , and ρ = n + i = 1 n p i . If V C ( X ) < 2 N 1 then X > 0 else X < 0 . Time complexity is O ( ( n + 1 ) l · log 2 ( ( n + 1 ) l ) ) .
Example 3.
X = ( 1 ,   2 ,   3 ) , moduli RNS: ( 11 ,   12 ,   13 ) , P = p 1 · p 2 · p 3 = 1716 , P 1 = P p 1 = 156 , P 2 = P p 2 = 143 , P 3 = P p 3 = 132 , ρ = 3 + 11 + 12 + 13 = 33 , and N = l o g 2 ( 33 · 1716 ) = 16 .
We calculate the coefficients W i :
W 1 = 2 N | P 1 1 | p 1 p i = 2 16 | 156 1 | 11 11 = 35,747 ,   W 2 = 2 N | P 2 1 | p 2 p 2 = 2 16 | 143 1 | 12 12 = 60,075 ,
W 3 = 2 N | P 3 1 | p 3 p 3 = 2 16 | 132 1 | 13 13 = 35,289
Thus, we can translate the number based on the coefficients
V C ( X ) = | 35,747 · 1 + 60,075 · 2 + 35,289 · 3 | 2 16 = 65,156
Therefore, the number is negative because 65,156 > 2 15 .
Algorithm 3 shows the pseudocode of the AM.
Algorithm 3: AM Method.
Input: ( x 1 , x 2 , , x n ) , ( W 1 , W 2 , , W n ) , and N
Output:   S
1. for  i = 1  to  n  do
1.1 s u m + = W i · x i
2 X = s u m   m o d   2 N  
3. if   ( X ( N 1 ) ) = = 1 :
3.1 S = 1
4. else:
4.1     S = 0

3.4. Diagonal Function

The positional characteristic of a number in RNS can be also determined by the so-called Diagonal Function (DF), which is defined by D ( X ) = i = 1 n X p i [2]. To calculate D ( X ) using moduli RNS, use the following formula:
D ( X ) = | i = 1 n k i * · x i | S Q ,
where k i * = | P i 1 | S Q , S Q = P 1 + P 2 + + P n .
The sign of the number depends on the comparison of D ( X ) and S Q / 2 . Let us look at an example of comparing numbers. The time complexity of the algorithm is O ( ( ( n 1 ) l + log 2 n ) 2 ) .
Example 4.
We consider the numbers of previous examples, X = ( 2 ,   2 ,   3 ) and moduli ( 3 ,   5 ,   7 ) . First, we calculate the values S Q   = 35 + 21 + 15 = 71 and k i .
k 1 * = | p 1 1 | 71 = | 3 1 | 71 = 47 ,
k 2 * = | p 2 1 | 71 = | 5 1 | 71 = 14 ,
k 3 * = | p 3 1 | 71 = | 7 1 | 71 = 10 .
Then, we find the value of the DF:
D ( X ) = | 2 · 47 + 2 · 14 + 3 · 10 | 71 = 10 .
Since 10 < 71 / 2 , then X is positive.
Algorithm 4 describes the pseudocode of the DF method.
Algorithm 4: DF Method.
Input :   S Q ,   ( x 1 , x 2 , , x n ) ,   and   ( k 1 * , k 2 * , , k n * )
Output :   S
1 .   for   i = 1   to   n  do
1.1   s u m + = k i * · x i
2   X = s u m   m o d   S Q  
3 .   if   X < S Q / 2 :
3.1   S = 1
4. else:
4.1     S = 0

3.5. Core Function

Burgess [26] proposed the minimal Akushsky Core Function (CF) based on the result obtained in [27,28]. This approach is similar to the DF method, and it does not need to calculate the critical cores.
The analytical form of the Pirlo function is calculated as:
P i ( X ) = | i = 1 n k i * * · x i | P n ,
where k i * * = | | P i 1 | p i · P i p n | .
If P i ( X ) < P n / 2 , then the number is positive, since the function under study is monotonically increasing. Time complexity is O ( ( n 1 ) 2 l 2 ) .
Let us consider an example of comparing numbers.
Example 5.
We take the numbers of previous examples, X = ( 2 ,   2 ,   3 ) and moduli ( 3 ,   5 ,   7 ) . First, let us calculate the values P 3 = 15 and k i * * as:
k 1 * * = | | P 1 1 | p 1 · P 1 p 3 | = | 2 · 35 7 | = 10 ,
k 1 * * = | | P 2 1 | p 2 · P 2 p 3 | = | 1 · 21 7 | = 3 ,
k 1 * * = | | P 3 1 | p 3 · P 3 p 3 | = | 1 · 15 7 | = 2 .
Then, we compute the Pirlo function:
P i ( X ) = | 2 · 10 + 2 · 3 + 3 · 2 | 15 = 2 .
Since 2 < 15 / 2 , the number is positive.
Algorithm 5 describes the pseudocode of the CF method.
Algorithm 5: CF Method.
Input :   P n ,   ( x 1 , x 2 , , x n ) ,   and   ( k 1 * * , k 2 * * , , k n * * )
Output :   S
1 .   for   i = 1   to   n  do
1.1   s u m + = k i * * · x i
2 .   X = s u m   m o d   P n
3 .   if   X < P n / 2 :
3.1   S = 1
4. else:
4.1     S = 0

3.6. Determining the Sign of a Number

Knowing the sign of a number can increase the performance of number comparison in RNS; the difference between numbers X and Y provides information about their comparison. Determining the Sign of a Number (DSN) in RNS is based on the fact that the residues x i ¯ of the negative number X are the complement of x i to the modulus p i . Hence, the following relationship holds:
S ( X ) = { 0 ,   i f   0 X < P 1 2 , 1 ,   i f P 1 2 X < P .
The formula based on CRT and an AM allows determining the sign of the number based on the following equation [29].
X P = | i = 1 n x i · | P i 1 | p i p i | 1 < 1 2 .
X > 0 if the equation holds; otherwise, X < 0 .
Let us consider the algorithm for comparing numbers in RNS based on DSN.
Example 6.
Let the number in RNS be ( 1 ,   0 ,   4 ) with the basis ( 3 ,   5 ,   7 ) . We determine the sign of the number by calculating Formula (8):
X P = | i = 1 3 x i · | P i 1 | p i   p i | 1 = | 2 3 + 4 7 | 1 = 5 21 < 1 2 .
So, the number is positive.
Algorithm 6 shows the pseudocode of the DSN method.
Algorithm 6: DSN Method.
Input :   ( x 1 , x 2 , , x n ) ,   ( p 1 , p 2 , , p n ) ,   and   ( | P 1 1 | p 1 , | P 2 1 | p 2 , , | P n 1 | p n )
Output :   S
1 .   for   i = 1   to   n  do:
1.1   S + = x i · ( P i 1 ) p i p i
2 .   S = S   m o d   1
3 .   if   S < 1 2 :
3.1   S = 1
4. else:
4.1     S = 0

3.7. Modified Diagonal Function

The Modified Diagonal Function (MDF) method reduces the computational complexity of comparing numbers in the RNS [5]. It proposes a new positional characteristic based on the DF and an AM. The essence of the MDF method is to calculate the relative value of the DF to S Q , which allows replacing the computationally complex operation of finding the residue of division by S Q by taking the fractional part of the number, and the coefficients k i * are replaced by the relative value k i * of S Q in Formula (5).
D ( X ) = | i = 1 n k ^ i · x i | 2 N M   ,
where k ^ i = [ k i · 2 N M S Q ] , N M > [ log 2 ( S Q · ( m 1 ) ) ] , and m = max 1 i n p i .
Let us look at an example of comparing numbers. Time complexity is
O ( ( ( n 1 ) l + log 2 n ) log 2 ( ( n 1 ) l + log 2 n ) ) .
Example 7.
We use the previously numbers X = ( 2 ,   2 ,   3 ) and moduli ( 3 ,   5 ,   7 ) . Then, we take 2 N M = 8.755 and value k i * from the diagonal function:
S Q = 35 + 21 + 15 = 71 ,
k 1 * = | p 1 1 | 71 = | 3 1 | 71 = 47 ,
k 2 * = | p 2 1 | 71 = | 5 1 | 71 = 14 .
We calculate k ^ i
k ^ 1 = 47 · 8.755 71 = 5.795 ,
k ^ 2 = 14 · 8.755 71 = 1.722 ,
k ^ 3 = 10 · 8.755 71 = 1.23 .
We find the value of the MDF:
D ( X ) = | 2 · 5.795 + 2 · 1.722 + 3 · 1.23 | 8.755 = 1.214 .
The number is positive, since 1.214 < 8.755 / 2 . Algorithm 7 shows the pseudocode of the MDF method.
Algorithm 7: MDF Method.
Input :   ( x 1 , x 2 , , x n ) ,   ( k ^ 1 , k ^ 2 , , k ^ n ) ,   and   2 N M
Output :   S
1 .   for   i = 1   to   n  do
1.1   s u m + = k ^ i · x i
2 .   X = s u m   m o d   2 N M
3 .   if   X < 2 N M / 2 :
3.1   S = 1
4 .   else :
4.1     S = 0

3.8. Determining the Sign of a Number in RNS with an Even Range

Here, we propose the efficient method Determining the Sign of a Number (DSN) in RNS with an Even Range (DSN-EN) for comparing numbers and determining the sign of a number for the case of an even RNS range.
Since the RNS range is an Even Number (EN), one of the RNS moduli is an EN. Without loss of generality, we assume that the module p n is even; then, using the property X a b = X a · b , the determination of a sign is reduced to a two-stage algorithm.
The first stage is dividing by an integer P n = P p n . The second stage is dividing by an integer p n 2 .
Formally, it is determined by the following formula:
S   ( X ) = 2 · X P = X P n · 2 p n .
The correctness of (10) follows from the proof of the following Theorem 1.
Theorem 1.
If X , a , and b are integer numbers with a , b 2 , then the equality holds:
X a · 1 b = X a · b .
Proof. 
Due to X a = X | X | a a , Equality (11) takes the form:
X a · 1 b = X | X | a a · b .
We represent X in the form X = a · b · X a · b + | X | a · b . Substituting it in (12), we have:
X | X | a a · b = X a · b + | X | a · b | X | a a · b .
Let X = ω · a + γ , where 0 γ a 1 , we obtain:
| ω · a | a · b = ω · a ω · a a · b · a · b = a ( ω ω b · b ) = a · | ω | b .
Considering that 0 | ω | b b 1 , then
0 a · | ω | b + γ a · ( b 1 ) + a 1 = a · b 1
and
| X | a · b = | ω · a + γ | a · b = | | ω · a | a · b + γ | a · b = | a · | ω | b + γ | a · b = a · | ω | b + γ .
Hence, | X | a · b | X | a = a · | ω | b + γ γ = a · | ω | b and
| X | a · b | X | a a · b = | ω | b b = 0 .
Substituting this result in (13), we have:
X | X | a a · b = X a · b .
The theorem is proved. □
Corollary 1.
Equation (10) is correct.
Proof. 
Let a = P n and b = p n 2 . Since p n is an even number, then p n 2 is an integer number. Therefore, the conditions of Theorem 1 are satisfied and the corollary is proved. The time complexity of the algorithm is O ( n 2 l ) . □
Example 8.
Let the RNS be given by the moduli p 1 = 17 ,   p 2 = 19 ,   p 3 = 23 , and p 4 = 32 . We determine the sign of a number X = ( 16 ,   18 ,   22 ,   15 ) and Y = ( 0 ,   0 ,   0 ,   16 ) . Let us calculate the synoptic weights:
w 1 , 2 = | p 1 1 | p 2 = | 1 17 | 19 = 9 ,
  w 1 , 3 = | p 1 1 | p 3 = | 1 17 | 23 = 19 ,  
w 1 , 4 = | p 1 1 | p 4 = | 1 17 | 32 = 17 ,
w 2 , 3 = | p 2 1 | p 3 = | 1 19 | 23 = 17 ,  
w 2 , 4 = | p 2 1 | p 4 = | 1 19 | 32 = 27 ,
  w 3 , 4 = | p 3 1 | p 4 = | 1 23 | 32 = 7 .
The number X is positive since
S ( X ) = 2 · x 4 ( 3 ) p 4   = 2 · 15 32 = 0 < 1 ,
and Y is negative because
S ( Y ) = 2 · y 4 ( 3 ) p 4 = 2 · 16 32 = 1 .
Algorithm 8 shows the pseudocode of the DSN with the EN method.
Algorithm 8: DSN-EN.
Input :   ( x 1 , x 2 , , x n ) ,   ( p 1 , p 2 , , p n ) ,   and   ( w 1 , 2 , w 1 , 3 , , w n , n )
Output :   S
1   for   i = 1   to   n  do
1.1   for   j = i + 1   to   n  do
1.1.1 x j = | ( x j x i ) · w i , j | p j
2 .   if   | 2 · x n p n | < 1 :
2.1   S = 1
4 .   else :
4.1     S = 0

4. Performance Evaluation

The proposed algorithm described in Section 3.8 has the advantage among the methods described in Section 3.
To confirm the properties, we implement all the algorithms using the high-level language C++ and compare their performance. The experiments are carried out on operating systems Windows 10 Home Edition on a computer with Intel Core i5-8250U 1.60 GHz, RAM DDR4 8 GB 1196 MHz, and SSD 512 GB.
For the analysis, we use a 128-bit number transferred to RNS, a set of six RNS moduli, and a width of 24 to 64 bits. We vary a vector length of 3 to 8 moduli with a 32-bit width.
The experimental results report the maximum, minimum, and average of 10,000 runs of each method. Additionally, we incorporate the average calculated based on the maximum and minimum values.
The information of the execution is presented in Appendix A. For simplicity, we only analyze the significant discoveries of the results. The average values have stable linear growth. The minimum values are prevailing because the average values of each method are very close to them. Hence, the maximum values are not common causes.
To avoid time measuring biases, the mean values are calculated as the average of 10,000 measuring of the maximum values and 10,000 measuring of the minimum values. We also consider the medium values of all methods to determine the most efficient ones.

Comparative Analysis

The performance of all methods for the operations of determining the sign of a number and number comparison is presented in Figure 1. DSN-EN has the highest performance for both operations with different numbers of modules p and dynamic bit width. AM, DF, and MDF are in the group of the second most efficient methods for all operations.
The results with a different number of modules p show: Considering the sign detection with respect to DSN-EN, the efficiency of AM is between 1.93 and 5.64 times worst. Likewise, DF and MDF are from 2.44 to 6.1 and from 2.11 to 5.64 times worst, respectively. Similar results present the comparison of numbers, DSN-EN improves AM within 1.55–4.6 times, DF among 1.75–4.47 times, and MDF within 1.93–4.57 times.
The results of comparison with different dynamic bit widths exhibit that DSN-EN is more efficient than MDF from 2.68 to 3.61 times, AM within 2.93–3.46 times, and MD between 2.97 and 3.44 times. For comparison of numbers, the differences are in 2.45–3.47, 2.48–3.47, and 2.56–3.43 for AM, DF, and MDF, respectively.
Figure 2 present a comparison between DSN-EN and AM, both methods with the best overall performance. From Figure 2a, we observe that the time difference is increased with respect to the number of modules for both operations. Figure 2b shows the execution time varying a dynamic bit width.
In general, the proposed method is several times more productive than AM, which was determined as the most efficient of the existing state-of-the-art ones. We consider that the DSN-EN can be applied efficiently in systems that use RNS.

5. Conclusions

Determining the sign of a number is fundamental for the implementation of several techniques with privacy preserving in untrusted environments. Current homomorphic encryption approaches try to make the implementation of this operation more efficient by using a residual number system. Unfortunately, the methods based on converting a number to a weight number system and determining the sign are inefficient and slow. The calculation of positional characteristics is better in performance but not efficient.
We propose a new method to determine the sign of a number in RNS and provide a theoretical foundation for when one modulo is an even number. We provide its performance evaluation compared with other determining the sign methods. The results show the advantages of our approach for different modules numbers and dynamic bit widths. In the future, we will study determining the sign of a number and comparing numbers in RNS for odd ranges.

Author Contributions

The authors have contributed in different parts of the paper preparation, as follows: Conceptualization, A.T. and M.B.; methodology, A.T., M.B., E.S. and A.A.; software, E.S., B.P.-G. and J.M.C.-M.; validation, E.S., B.P.-G., J.M.C.-M. and V.K.; formal analysis, A.T., M.B., E.S. and A.Y.D.; investigation, A.T., M.B., E.S. and A.A.; resources, E.S., and B.P.-G.; data curation, B.P.-G. and J.M.C.-M.; writing—original draft preparation, A.T., M.B., E.S., A.Y.D. and V.K.; writing—review and editing, A.T., B.P.-G., J.M.C.-M. and A.A.; visualization, B.P.-G. and J.M.C.-M.; supervision, A.T. and M.B.; project administration, A.T. and M.B.; funding acquisition, M.B. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Ministry of Education and Science of the Russian Federation (Project 075-15-2020-915).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data is contained within the article.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Table A1 presents the time in milliseconds (ms) needed to determine the number’s sign and comparison of numbers for considered methods with a dynamic number of modules p based on the 10,000 measurements.
Table A1. Operation time with a dynamic number of modules p (ms).
Table A1. Operation time with a dynamic number of modules p (ms).
MethodModulesNumber’s SignComparison
MaxMeanMinMean–MinMaxMeanMinMean–Min
CRT30.11300.02380.02290.00090.18760.03700.03550.0015
40.14510.02920.02870.00050.15620.05340.04340.0100
50.15470.03980.03810.00170.23810.05340.05100.0024
60.23550.04110.04040.00070.24710.06220.05870.0035
70.20900.04880.04670.00210.27250.06940.06650.0029
80.24990.05380.05200.00180.42140.07760.07410.0035
MRC30.08950.02270.01270.01000.07020.03000.01000.0200
40.09880.02780.01720.01060.09270.03260.01240.0202
50.08390.03150.02080.01070.07000.03510.01460.0205
60.12080.03500.02450.01050.09330.03750.01690.0206
70.14000.03890.02820.01070.13940.03990.01930.0206
80.15250.04400.03290.01110.11470.04270.02210.0206
AM30.06570.01120.01090.00030.06170.01530.01480.0005
40.09170.01320.01300.00020.09210.01890.01830.0006
50.09020.01540.01510.00030.12780.02230.02170.0006
60.06540.01810.01730.00080.12440.02620.02520.0010
70.09350.01960.01930.00030.11510.03010.02860.0015
80.11100.02190.02140.00050.18670.03360.03200.0016
DF30.05980.01300.01140.00160.08190.01650.01570.0008
40.06850.01550.01340.00210.08330.01960.01890.0007
50.08350.01760.01530.00230.12700.02290.02210.0008
60.10920.01960.01730.00230.13650.02640.02520.0012
70.10610.02220.01930.00290.15750.02950.02840.0011
80.09480.02340.02110.00230.19690.03280.03150.0013
CF30.10250.01940.01900.00040.11870.02790.02710.0008
40.12100.02360.02300.00060.19100.03930.03720.0021
50.13860.03190.03120.00070.18400.04180.04010.0017
60.17690.03210.03120.00090.21560.05050.04660.0039
70.18310.03690.03610.00080.32870.05660.05460.0020
80.19840.04120.03990.00130.29070.06340.06090.0025
MDF30.08170.01250.01180.00070.09420.01760.01630.0013
40.06600.01400.01380.00020.09400.02010.01950.0006
50.09090.01610.01580.00030.14930.02440.02270.0017
60.09820.01800.01780.00020.12580.02700.02580.0012
70.10130.02010.01970.00040.12930.03010.02900.0011
80.11000.02190.02170.00020.17680.03340.03220.0012
SDM30.09830.01420.01380.00040.11640.02530.02410.0012
40.11880.01800.01780.00020.15310.03300.03160.0014
50.11860.02700.02560.00140.18090.04140.03900.0024
60.11370.02680.02620.00060.20730.04850.04700.0015
70.16520.03190.03070.00120.22890.05810.05510.0030
80.17800.03590.03490.00100.30360.06610.06320.0029
DSN-EN30.04870.00330.00330.00000.04280.00600.00590.0001
40.03590.00450.00420.00030.05960.00670.00660.0001
50.02470.00340.00330.00010.04430.00750.00740.0001
60.03840.00380.00380.00000.06750.00660.00650.0001
70.06680.00420.00420.00000.04000.00670.00650.0002
80.03430.00330.00330.00000.02180.00600.00580.0002
Table A2 shows the time (ms) needed to determine the number’s sing and comparison of numbers for with a dynamic bit width based on the 10,000 measurements.
Table A2. Operation time with a dynamic bit width (ms).
Table A2. Operation time with a dynamic bit width (ms).
MethodSizeNumber’s SignComparison
MaxMeanMinMean–MinMaxMeanMinMean–Min
CRT240.28490.04750.04150.00600.29740.06900.06250.0065
320.20350.04700.04420.00280.27810.06550.06270.0028
400.19420.04500.04330.00170.29590.06580.06260.0032
480.23440.04740.04560.00180.31040.06570.06260.0031
560.20780.04720.04550.00170.38460.06670.06290.0038
640.26260.04830.04650.00180.34430.06610.06300.0031
MRC240.15040.03170.02200.00970.07610.06610.01550.0506
320.13590.02510.02440.00070.09500.06760.01690.0507
400.12920.02610.02550.00060.08440.06760.01710.0505
480.11370.02730.02620.00110.20310.06830.01770.0506
560.11680.02820.02700.00120.09200.06880.01820.0506
640.14120.03240.03190.00050.09780.07120.02060.0506
AM240.12200.02450.01710.00740.14360.02570.02500.0007
320.06790.01740.01720.00020.13630.02590.02510.0008
400.10270.01740.01720.00020.09790.02590.02500.0009
480.11030.01740.01720.00020.12730.02600.02500.0010
560.09800.01770.01730.00040.14880.02630.02510.0012
640.09900.01750.01730.00020.16150.02680.02510.0017
DF240.17670.02290.01720.00570.17770.02620.02510.0011
320.07750.01730.01730.00000.17460.02590.02510.0008
400.10140.01740.01720.00020.17950.02610.02510.0010
480.09840.01760.01720.00040.11240.02640.02510.0013
560.06800.01790.01730.00060.12500.02600.02520.0008
640.10060.01790.01740.00050.13970.02680.02520.0016
CF240.73790.03790.03340.00450.19490.04700.04390.0031
320.13920.03660.03490.00170.20620.04860.04660.0020
400.18100.03900.03700.00200.49730.05690.05440.0025
480.13910.03490.03420.00070.23730.05460.05270.0019
560.13510.03500.03400.00100.22820.05430.05210.0022
640.14670.03930.03760.00170.20490.05770.05480.0029
MDF240.10790.02060.01940.00120.14500.02650.02570.0008
320.10480.01800.01780.00020.13030.02710.02580.0013
400.12460.01810.01770.00040.17110.02670.02570.0010
480.07230.01800.01770.00030.12800.02670.02570.0010
560.09640.01800.01770.00030.12110.02660.02560.0010
640.11500.01830.01780.00050.13110.02660.02580.0008
SDM240.17090.03990.02860.01130.21510.04630.04440.0019
320.18450.04390.04010.00380.18810.04890.04680.0021
400.12270.02870.02790.00080.23130.05250.05050.0020
480.11450.02980.02860.00120.24290.05490.05190.0030
560.13170.02940.02870.00070.24040.05400.05190.0021
640.11430.03360.03140.00220.21020.05700.05360.0034
DSN-EN240.02590.00560.00340.00220.04280.00600.00590.0001
320.02740.00390.00380.00010.05960.00670.00660.0001
400.03920.00430.00420.00010.04430.00750.00740.0001
480.03420.00440.00380.00060.06750.00660.00650.0001
560.03920.00450.00370.00080.04000.00670.00650.0002
640.04800.00440.00340.00100.02180.00600.00580.0002
Figure A1, Figure A2, Figure A3, Figure A4, Figure A5, Figure A6, Figure A7 and Figure A8 present the maximum, minimum, and average time in seconds (s) of sign detection and comparison.
Figure A1. Performance of CRT method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Figure A1. Performance of CRT method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Computation 10 00017 g0a1aComputation 10 00017 g0a1b
Figure A2. Performance of MRC method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic number of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Figure A2. Performance of MRC method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic number of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Computation 10 00017 g0a2
Figure A3. Performance of the Approximate Method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare the dynamic number of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Figure A3. Performance of the Approximate Method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare the dynamic number of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Computation 10 00017 g0a3aComputation 10 00017 g0a3b
Figure A4. Performance of the Diagonal Method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Figure A4. Performance of the Diagonal Method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Computation 10 00017 g0a4
Figure A5. Performance of the Core Method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Figure A5. Performance of the Core Method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Computation 10 00017 g0a5aComputation 10 00017 g0a5b
Figure A6. Performance of the Modify Diagonal Method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Figure A6. Performance of the Modify Diagonal Method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Computation 10 00017 g0a6
Figure A7. Performance of the Sign of Number Method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Figure A7. Performance of the Sign of Number Method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Computation 10 00017 g0a7aComputation 10 00017 g0a7b
Figure A8. Performance of the DSN-EN method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Figure A8. Performance of the DSN-EN method to (a) determine the number’s sign with a dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with dynamic bit width.
Computation 10 00017 g0a8

References

  1. Pirlo, G.; Impedovo, D. A new class of monotone functions of the residue number system. Int. J. Math. Models Methods Appl. Sci. 2013, 7, 803–809. [Google Scholar]
  2. Piestrak, S.J. A note on RNS architectures for the implementation of the diagonal function. Inf. Process. Lett. 2015, 115, 453–457. [Google Scholar] [CrossRef]
  3. Dimauro, G.; Impedovo, S.; Pirlo, G. A new technique for fast number comparison in the residue number system. IEEE Trans. Comput. 1993, 42, 608–612. [Google Scholar] [CrossRef]
  4. Babenko, M.; Deryabin, M.; Piestrak, S.; Patronik, P.; Chervyakov, N.; Tchernykh, A.; Avetisyan, A. RNS Number Comparator Based on a Modified Diagonal Function. Electronics 2020, 9, 1784. [Google Scholar] [CrossRef]
  5. Van Vu, T. Efficient implementations of the Chinese remainder theorem for sign detection and residue decoding. IEEE Trans. Comput. 1985, 100, 646–651. [Google Scholar] [CrossRef]
  6. Babenko, M.G.; Tchernykh, A.N.; Chervyakov, N.I.; Kuchukov, V.A.; Miranda-López, V.; Rivera-Rodriguez, R.; Du, Z. Efficient number comparison in the residue number system based on positional characteristics. Proc. Inst. Syst. Program. RAS 2019, 31, 187–202. [Google Scholar] [CrossRef]
  7. Babenko, M.; Piestrak, S.J.; Chervyakov, N.; Deryabin, M. The Study of Monotonic Core Functions and Their Use to Build RNS Number Comparators. Electronics 2021, 10, 1041. [Google Scholar] [CrossRef]
  8. Isupov, K.; Knyazkov, V.; Kuvaev, A. Design and implementation of multiple-precision BLAS Level 1 functions for graphics processing units. J. Parallel Distrib. Comput. 2020, 140, 25–36. [Google Scholar] [CrossRef]
  9. Isupov, K. Using Floating-Point Intervals for Non-Modular Computations in Residue Number System. IEEE Access 2020, 8, 58603–58619. [Google Scholar] [CrossRef]
  10. Gentry, C. A Fully Homomorphic Encryption Scheme; Stanford University: Stanford, CA, USA, 2009. [Google Scholar]
  11. Pulido-Gaytan, B.; Tchernykh, A.; Cortés-Mendoza, J.M.; Babenko, M.; Radchenko, G.; Avetisyan, A.; Drozdov, A.Y. Privacy-preserving neural networks with Homomorphic encryption: Challenges and opportunities. Peer-Peer Netw. Appl. 2021, 14, 1666–1691. [Google Scholar] [CrossRef]
  12. Cortés-Mendoza, J.M.; Tchernykh, A.; Babenko, M.; Pulido-Gaytán, L.B.; Radchenko, G.; Leprevost, F.; Wang, X.; Avetisyan, A. Privacy-preserving logistic regression as a cloud service based on residue number system. In Russian Supercomputing Days; Springer Cham: Berlin/Heidelberg, Germany, 2020. [Google Scholar]
  13. Kamara, S.; Kristin, L. Cryptographic Cloud Storage. In International Conference on Financial Cryptography and Data Security; Springer: Berlin/Heidelberg, Germany, 2010. [Google Scholar]
  14. Kucherov, N.; Kuchukova, E.; Tchernykh, A.; Kuchukov, V.; Babenko, M. Towards Optimizing Cloud Computing Using Residue Number System. J. Phys. Conf. Ser. 2021, 1715, 012052. [Google Scholar] [CrossRef]
  15. Babenko, M.; Tchernykh, A.; Golimblevskaia, E.; Pulido-Gaytan, L.B.; Avetisyan, A. Homomorphic Comparison Methods: Technologies, Challenges, and Opportunities. In Proceedings of the 2020 International Conference Engineering and Telecommunication (En&T), IEEE, Dolgoprudny, Russia, 25–26 November 2020. [Google Scholar]
  16. Babenko, M.; Tchernykh, A.; Pulido-Gaytan, B.; Golimblevskaia, E.; Cortés-Mendoza, J.M.; Avetisyan, A. Experimental Evaluation of Homomorphic Comparison Methods. In Proceedings of the 2020 Ivannikov Ispras Open Conference (ISPRAS), Moscow, Russia, 10–11 December 2020. [Google Scholar]
  17. Lee, Y.; Lee, J.-W.; Kim, Y.-S.; No, J.-S. Near-optimal polynomial for modulus reduction using l2-norm for approximate homomorphic encryption. IEEE Access 2020, 8, 144321–144330. [Google Scholar] [CrossRef]
  18. Chase, M.; Chen, H.; Ding, J.; Goldwasser, S.; Gorbunov, S.; Hoffstein, J.; Lauter, K.; Lokam, S.; Moody, D.; Morrison, T.; et al. Security of homomorphic encryption. HomomorphicEncryption. Org. Redmond WA. Tech. Rep. 2017. [Google Scholar]
  19. Shiryaev, E.; Golimblevskaia, E.; Babenko, M.; Tchernykh, A.; Pulido-Gaytan, B. Improvement of the Approximate Method for the Comparison Operation in the RNS. In Proceedings of the 2020 International Conference Engineering and Telecommunication (En&T), IEEE, Dolgoprudny, Russia, 25–26 November 2020. [Google Scholar]
  20. Babenko, M.; Tchernykh, A.; Chervyakov, N.; Kuchukov, V.; Miranda-López, V.; Rivera-Rodriguez, R.; Du, Z.; Talbi, E.-G. Positional Characteristics for Efficient Number Comparison over the Homomorphic Encryption. Program. Comput. Softw. 2019, 45, 532–543. [Google Scholar] [CrossRef]
  21. Pulido-Gaytan, L.B.; Tchernykh, A.; Cortés-Mendoza, J.M.; Babenko, M.; Radchenko, G. A Survey on Privacy-Preserving Machine Learning with Fully Homomorphic Encryption. In Communications in Computer and Information Science; Springer: Berlin/Heidelberg, Germany, 2021; pp. 115–129. [Google Scholar] [CrossRef]
  22. Garner, H.L. The residue number system. Presented at the Western Joint Computer Conference (IRE-AIEE-ACM ’59 (Western)), San Francisco, CA, USA, 3–5 March 1959. [Google Scholar] [CrossRef]
  23. Pei, D.; Arto, S.; Cunsheng, D. Chinese Remainder Theorem: Applications in Computing, Coding, Cryptography; World Scientific: Singapore, 1996. [Google Scholar]
  24. Yassine, H.M.; Moore, W.R. Improved mixed-radix conversion for residue number system architectures. IEE Proc. G Circuits Devices Syst. 1991, 138, 120–124. [Google Scholar] [CrossRef]
  25. Chervyakov, N.I.; Molahosseini, A.S.; Lyakhov, P.A.; Babenko, M.G.; Deryabin, M.A. Residue-to-binary conversion for general moduli sets based on approximate Chinese remainder theorem. Int. J. Comput. Math. 2016, 94, 1833–1849. [Google Scholar] [CrossRef]
  26. Burgess, N. Scaled and unscaled residue number system to binary conversion techniques using the core function. In Proceedings of the 13th IEEE Sympsoium on Computer Arithmetic, Asilomar, CA, USA, 6–9 July 1997. [Google Scholar]
  27. Miller, D.D.; Altschul, R.E.; King, J.R.; Polky, J.N. Analysis of the Residue Class Core Function of Akushskii, Burcev, and Pak. In Residue Number System Arithmetic: Modern Applications in Digital Signal Processing; IEEE Publications: Manhattan, NY, USA, 1986; pp. 390–401. [Google Scholar]
  28. Gonnella, J. The application of core functions to residue number systems. IEEE Trans. Signal Processing 1991, 39, 69–75. [Google Scholar] [CrossRef]
  29. Chervyakov, N.I.; Babenko, M.G.; Deryabin, M.A.; Nazarov, A.S.; Shabalina, M.N. Computation of Positional Characteristics of Numbers in RNS Based on Approximate Method. In Proceedings of the 2016 IEEE NW Russia Young Researchers in Electrical and Electronic Engineering Conference (EIConRusNW), St. Petersburg, Russia, 2–3 February 2016. [Google Scholar]
Figure 1. Performance of all methods to (a) determine the number’s sign with the dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with a dynamic bit width.
Figure 1. Performance of all methods to (a) determine the number’s sign with the dynamic number of modules p , (b) compare dynamic numbers of modules p , (c) determine the number’s sign with a dynamic bit width, and (d) compare numbers with a dynamic bit width.
Computation 10 00017 g001aComputation 10 00017 g001b
Figure 2. Comparison of DSN-EN and AM methods for determination of the number’s sign and comparison with (a) a dynamic number of modules p and (b) a dynamic bit width.
Figure 2. Comparison of DSN-EN and AM methods for determination of the number’s sign and comparison with (a) a dynamic number of modules p and (b) a dynamic bit width.
Computation 10 00017 g002
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Tchernykh, A.; Babenko, M.; Shiriaev, E.; Pulido-Gaytan, B.; Cortés-Mendoza, J.M.; Avetisyan, A.; Drozdov, A.Y.; Kuchukov, V. An Efficient Method for Comparing Numbers and Determining the Sign of a Number in RNS for Even Ranges. Computation 2022, 10, 17. https://doi.org/10.3390/computation10020017

AMA Style

Tchernykh A, Babenko M, Shiriaev E, Pulido-Gaytan B, Cortés-Mendoza JM, Avetisyan A, Drozdov AY, Kuchukov V. An Efficient Method for Comparing Numbers and Determining the Sign of a Number in RNS for Even Ranges. Computation. 2022; 10(2):17. https://doi.org/10.3390/computation10020017

Chicago/Turabian Style

Tchernykh, Andrei, Mikhail Babenko, Egor Shiriaev, Bernardo Pulido-Gaytan, Jorge M. Cortés-Mendoza, Arutyun Avetisyan, Alexander Yu Drozdov, and Viktor Kuchukov. 2022. "An Efficient Method for Comparing Numbers and Determining the Sign of a Number in RNS for Even Ranges" Computation 10, no. 2: 17. https://doi.org/10.3390/computation10020017

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop