svp

Crates.iosvp
lib.rssvp
version0.2.0
sourcesrc
created_at2022-10-12 13:46:49.378527
updated_at2022-10-13 03:24:47.281127
descriptionLattice sieving over the integers with arbitrary precision.
homepage
repositoryhttps://github.com/tacotaha/svp
max_upload_size
id686322
size127,808
Taha Azzaoui (tacotaha)

documentation

README

SVP

Lattice sieving over the integers with arbitrary precision.

Includes the sampling algorithm described by [GPV08] and the Gauss Sieve described in [MV10].

Example

use svp::*;

// LLL/BKZ reduced basis
let mut b = vec![
    nvec![
        Integer::new(),
        Integer::new(),
        Integer::new(),
        Integer::from(-1),
        Integer::from(-1)
    ],
    nvec![
        Integer::from(-1),
        Integer::from(-2),
        Integer::from(-2),
        Integer::from(-1),
        Integer::from(1)
    ],
    nvec![
        Integer::from(3),
        Integer::new(),
        Integer::from(-1),
        Integer::from(-1),
        Integer::from(1)
    ],
    nvec![
        Integer::from(-1),
        Integer::from(3),
        Integer::from(-2),
        Integer::from(2),
        Integer::from(-2)
    ],
    nvec![
        Integer::from(2),
        Integer::from(-3),
        Integer::from(1),
        Integer::from(2),
        Integer::from(-2)
    ],
];

// Compute squared norms
for i in 0..b.len() {
    b[i].norm = Some(&b[i] * &b[i]);
}

// Init lattice
let l = Lattice { basis: b.clone() };

// Rejection sampling parameter
let t = Float::with_val(53, b.len()).ln();

// Init Gasuss Sieve
let mut gs = gsieve![l, t];

// Short vectors sorted in ascending order
let short_vecs = gs.sieve();
Commit count: 0

cargo fmt