script update + readme

This commit is contained in:
Sam Hadow 2025-04-30 14:22:28 +02:00
parent 477587aa68
commit d858373b51
3 changed files with 30 additions and 4 deletions

View File

@ -0,0 +1,26 @@
Rust implementation for the approximate greatest common divisor (AGCD) problem using LLL algorithm.
## commands
*use the provided Makefile to compile the release version*
```
approximate-gcd agcd <path to input file>
```
Input file must have the following format:
+ first non-comment line: number of noise bits (written in decimal)
+ all the other lines, one per line: the numbers Xi (written in decimal) to find the approximate GCD of
+ ```//``` can be used to comment a line, MUST be used at the begining of a new line and not at the end of a line containing a number
### generating values
The script gen_values can be used to generate test values
```
python gen_values.py [--noise-bits <number of noise bits>] [--number <number of values to generate>]
```
the output can be directly written to a file
```
python gen_values.py [options] > input.txt
```

View File

@ -4,9 +4,9 @@ import argparse
def generate_test_file(noise_bits, number):
p = random.randint(100, 1000)
p = random.randint(1000, 10000)
while p % 2 == 0:
p = random.randint(100, 1000)
p = random.randint(1000, 10000)
max_noise = (1 << noise_bits) - 1 # 2^noise_bits - 1

View File

@ -120,11 +120,11 @@ mod tests {
int!(8),
int!(12),
int!(0),
int!(-5),
int!(5),
int!(0),
int!(0),
int!(0),
int!(-5),
int!(5),
];
let lattice = Matrix::new_lattice(noise_bits, ciphertexts).unwrap();