Skip to content

Commit 0541a9b

Browse files
authored
Merge pull request #526 from qfall/adapt_to_rand_changes
Update according to breaking changes in rand-crate
2 parents b15cdb0 + 99b0968 commit 0541a9b

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "qfall-math"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition = "2024"
5-
rust-version = "1.85" # due to rand and rand_distr dependency
5+
rust-version = "1.87" # due to wit_bindgen dependency
66
description = "Mathematical foundations for rapid prototyping of lattice-based cryptography"
77
readme = "README.md"
88
homepage = "https://qfall.github.io"
@@ -17,8 +17,8 @@ criterion = { version = "0.8", features = ["html_reports"] }
1717
flint-sys = "0.7"
1818
libc = "0"
1919
paste = "1"
20-
rand = "0"
21-
rand_distr = "0"
20+
rand = "0.10"
21+
rand_distr = "0.6"
2222
regex = "1"
2323
serde = {version="1", features=["derive"]}
2424
serde_json = "1"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This `math`-crate is a memory-safe wrapper of [FLINT](https://flintlib.org/) in
1111

1212
## Quick-Start
1313
First, ensure that you use a Unix-like distribution (Linux or MacOS). Setup [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) if you're using Windows. This is required due to this crate's dependency on FLINT.
14-
Then, make sure your `rustc --version` is `1.85` or newer.
14+
Then, make sure your `rustc --version` is `1.87` or newer.
1515

1616
Furthermore, it's required that `m4`, a C-compiler such as `gcc`, and `make` are installed.
1717
```bash

src/rational/mat_q/sample/gauss.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use probability::{
1717
prelude::{Gaussian, Sample},
1818
source,
1919
};
20-
use rand::RngCore;
20+
use rand::Rng;
2121
use std::fmt::Display;
2222

2323
impl MatQ {

src/rational/poly_over_q/sample/gauss.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use probability::{
1919
prelude::{Gaussian, Sample},
2020
source,
2121
};
22-
use rand::RngCore;
22+
use rand::Rng;
2323
use std::fmt::Display;
2424

2525
impl PolyOverQ {

src/rational/q/sample/gauss.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use probability::{
1313
distribution::{Gaussian, Sample},
1414
source,
1515
};
16-
use rand::RngCore;
16+
use rand::Rng;
1717

1818
impl Q {
1919
/// Chooses a [`Q`] instance according to the continuous Gaussian distribution.

src/utils/sample/discrete_gauss.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::{
2323
rational::{MatQ, Q},
2424
traits::{MatrixDimensions, MatrixGetSubmatrix, Pow},
2525
};
26-
use rand::Rng;
26+
use rand::RngExt;
2727
use serde::{Deserialize, Serialize};
2828
use std::collections::HashMap;
2929

src/utils/sample/uniform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
use crate::{error::MathError, integer::Z};
1313
use flint_sys::fmpz::{fmpz_addmul_ui, fmpz_set_ui};
14-
use rand::{RngCore, rngs::ThreadRng};
14+
use rand::{Rng, rngs::ThreadRng};
1515

1616
/// Enables uniformly random sampling a [`Z`] in `[0, interval_size)`.
1717
///

0 commit comments

Comments
 (0)