Four-Square Number Calculation Speedup and Timing Attack Resistance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for expressing a natural number as the sum of four square numbers are inefficient, particularly for small bit lengths, taking around 2 ms on average, and are not resistant to timing attacks.
Innovation Solution
An information processing apparatus and method that calculates the square roots of four square numbers by determining the largest even value or two less than the square root of the natural number, allowing for high-speed calculations with a calculation amount of O(n1/2) and resistance to timing attacks, using a combination of deterministic and randomized algorithms based on bit length thresholds.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If the existing method for expressing a natural number as the sum of four square numbers is used, then the calculation can be performed, but the calculation time is approximately 2 ms on average for small bit lengths which is not sufficiently fast
Solution Approach 1:
The patent changes the parameter of the search strategy by determining the square root of the first square number as the largest even value or two less than the largest even value among even numbers equal to or less than the square root of the natural number. This parameter change in the search approach reduces the calculation time from approximately 2 ms to approximately 0.1 ms for 32-bit natural numbers, achieving a 20-fold speedup while maintaining calculation accuracy.
2Speed
If a deterministic algorithm is used for high-speed calculation, then the calculation speed increases, but the system becomes vulnerable to timing attacks
Solution Approach 1:
The patent implements a dynamic algorithm selection mechanism that adapts based on the bit length of the input natural number. For smaller bit lengths, it uses a deterministic algorithm optimized for speed (achieving approximately 0.1 ms for 32-bit numbers). For larger bit lengths, it switches to a randomized algorithm to maintain resistance against timing attacks. This dynamic adaptation allows the system to optimize performance for each specific input size while maintaining security where needed.
Solution Approach 2:
The patent segments the calculation problem based on the bit length of the natural number, dividing it into different ranges that require different algorithmic approaches. By segmenting the input space and applying different algorithms to different segments, the system achieves high-speed calculation for small inputs while maintaining security properties for larger inputs, thus resolving the contradiction between speed and timing attack resistance.
Data Source
AI summary
[Object]A calculation in which a natural number is expressed by four square numbers is performed at higher speed.[Solving Means]Provided is an information processing apparatus including a calculation unit that performs a calculation to express a certain natural number by the sum of a first square number, a second square number, a third square number, and a fourth square number. The calculation unit calculates, as the square root of the first square number, the largest value or a value smaller by two than the largest value among even numbers equal to or less than the square root of the natural number and then searches for the respective square roots of the second square number, the third square number, and the fourth square number.


