facebookresearch / LWE-benchmarking

This repository contains code to generate and preprocess Learning with Errors (LWE) data and implementations of four LWE attacks uSVP, SALSA, Cool&Cruel, and Dual Hybrid Meet-in-the-Middle (MitM). We invite contributors to reproduce our results, improve on these methods, and/or suggest new concrete attacks on LWE.
Other
22 stars 0 forks source link

Salsa toy example loading issue #1

Open alexgit256 opened 4 days ago

alexgit256 commented 4 days ago

Hello,

I believe I am having issues with running the Salsa attack on a provided toy example. I downloaded the "80_7_omega15_lwe_data_prefix.tar.gz" and extracted it using the following command:

tar -xvf 80_7_omega15_lwe_data_prefix.tar.gz -C ./test_data

This created the "data.prefix" file in "./test_data". I assume that this file contains the preprocessed data. Since I want to use the provided secrets and preprocessed data, I use the following command (as per instruction from the Salsa section):

python3 src/generate/generate_A_b.py --processed_dump_path /test_data/ --secret_path ./data/benchmark_paper_data/n80_logq7/binary_secrets_h5_6/secret.npy --dump_path ./testn80 --N 80 --rlwe 1 --actions secrets

Then I get the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/test_data/params.pkl'

Note that the following command works:

python3 src/generate/generate_A_b.py --processed_dump_path ./data/benchmark_paper_data/n80_logq7/ --secret_path ./data/benchmark_paper_data/n80_logq7/binary_secrets_h5_6/secret.npy --dump_path ./testn80 --N 80 --rlwe 1 --actions secrets

How do I get the "params.pkl" file corresponding to the toy example you provide?

eshika commented 3 days ago

Hi, thanks for reaching out! The params.pkl file for the toy example is located at: ./data/benchmark_paper_data/n80_logq7/params.pkl

To resolve the error, you can either:

  1. Copy ./data/benchmark_paper_data/n80_logq7/params.pkl into /test_data/ and run the same command
  2. Extract the tar into the /data/benchmark_paper_data/n80_logq7/ directory within the repository and run the command with --processed_dump_path ./data/benchmark_paper_data/n80_logq7/

Hope this helps, let us know if either of these solutions resolve the issue. Thanks!