ff: Rename PrimeField::into_repr -> PrimeField::to_repr

This commit is contained in:
Jack Grigg
2020-05-02 18:55:13 +12:00
parent 9114c367f4
commit c597db59a6
35 changed files with 106 additions and 106 deletions

View File

@@ -155,7 +155,7 @@ fn bench_fq_sqrt(c: &mut Criterion) {
});
}
fn bench_fq_into_repr(c: &mut Criterion) {
fn bench_fq_to_repr(c: &mut Criterion) {
const SAMPLES: usize = 1000;
let mut rng = XorShiftRng::from_seed([
@@ -166,10 +166,10 @@ fn bench_fq_into_repr(c: &mut Criterion) {
let v: Vec<Fq> = (0..SAMPLES).map(|_| Fq::random(&mut rng)).collect();
let mut count = 0;
c.bench_function("Fq::into_repr", |b| {
c.bench_function("Fq::to_repr", |b| {
b.iter(|| {
count = (count + 1) % SAMPLES;
v[count].into_repr()
v[count].to_repr()
})
});
}
@@ -183,7 +183,7 @@ fn bench_fq_from_repr(c: &mut Criterion) {
]);
let v: Vec<FqRepr> = (0..SAMPLES)
.map(|_| Fq::random(&mut rng).into_repr())
.map(|_| Fq::random(&mut rng).to_repr())
.collect();
let mut count = 0;
@@ -204,6 +204,6 @@ criterion_group!(
bench_fq_invert,
bench_fq_neg,
bench_fq_sqrt,
bench_fq_into_repr,
bench_fq_to_repr,
bench_fq_from_repr,
);

View File

@@ -155,7 +155,7 @@ fn bench_fr_sqrt(c: &mut Criterion) {
});
}
fn bench_fr_into_repr(c: &mut Criterion) {
fn bench_fr_to_repr(c: &mut Criterion) {
const SAMPLES: usize = 1000;
let mut rng = XorShiftRng::from_seed([
@@ -166,10 +166,10 @@ fn bench_fr_into_repr(c: &mut Criterion) {
let v: Vec<Fr> = (0..SAMPLES).map(|_| Fr::random(&mut rng)).collect();
let mut count = 0;
c.bench_function("Fr::into_repr", |b| {
c.bench_function("Fr::to_repr", |b| {
b.iter(|| {
count = (count + 1) % SAMPLES;
v[count].into_repr()
v[count].to_repr()
})
});
}
@@ -183,7 +183,7 @@ fn bench_fr_from_repr(c: &mut Criterion) {
]);
let v: Vec<FrRepr> = (0..SAMPLES)
.map(|_| Fr::random(&mut rng).into_repr())
.map(|_| Fr::random(&mut rng).to_repr())
.collect();
let mut count = 0;
@@ -204,6 +204,6 @@ criterion_group!(
bench_fr_invert,
bench_fr_neg,
bench_fr_sqrt,
bench_fr_into_repr,
bench_fr_to_repr,
bench_fr_from_repr,
);