Skip to content

Commit a3c2ba0

Browse files
committed
fmt
1 parent 125343b commit a3c2ba0

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

curve25519-dalek/src/backend/serial/fiat_u32/field.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,13 @@ impl FieldElement2625 {
282282

283283
// start from least significant go to most significant
284284
for i in 0..10 {
285-
_ul = self.0[i];
286-
_vl = other.0[i];
285+
_ul = self.0[i];
286+
_vl = other.0[i];
287287

288-
gt_i = _ul > _vl;
289-
eq_i = _ul == _vl;
288+
gt_i = _ul > _vl;
289+
eq_i = _ul == _vl;
290290

291-
c_gt = gt_i || (eq_i & c_gt);
291+
c_gt = gt_i || (eq_i & c_gt);
292292
}
293293

294294
Choice::from(c_gt as u8)

curve25519-dalek/src/backend/serial/fiat_u64/field.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ impl FieldElement51 {
260260
output
261261
}
262262

263-
264263
/// Returns 1 if self is greater than the other and 0 otherwise
265264
// strategy: check if b-a overflows. if it does not overflow, then a was larger
266265
pub(crate) fn gt_direct(&self, other: &Self) -> Choice {
@@ -274,13 +273,13 @@ impl FieldElement51 {
274273

275274
// start from least significant go to most significant
276275
for i in 0..5 {
277-
_ul = self.0[i];
278-
_vl = other.0[i];
276+
_ul = self.0[i];
277+
_vl = other.0[i];
279278

280-
gt_i = _ul > _vl;
281-
eq_i = _ul == _vl;
279+
gt_i = _ul > _vl;
280+
eq_i = _ul == _vl;
282281

283-
c_gt = gt_i || (eq_i & c_gt);
282+
c_gt = gt_i || (eq_i & c_gt);
284283
}
285284

286285
Choice::from(c_gt as u8)

curve25519-dalek/src/backend/serial/u32/field.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -615,13 +615,13 @@ impl FieldElement2625 {
615615

616616
// start from least significant go to most significant
617617
for i in 0..10 {
618-
_ul = self.0[i];
619-
_vl = other.0[i];
618+
_ul = self.0[i];
619+
_vl = other.0[i];
620620

621-
gt_i = _ul > _vl;
622-
eq_i = _ul == _vl;
621+
gt_i = _ul > _vl;
622+
eq_i = _ul == _vl;
623623

624-
c_gt = gt_i || (eq_i & c_gt);
624+
c_gt = gt_i || (eq_i & c_gt);
625625
}
626626

627627
Choice::from(c_gt as u8)

curve25519-dalek/src/backend/serial/u64/field.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -586,13 +586,13 @@ impl FieldElement51 {
586586

587587
// start from least significant go to most significant
588588
for i in 0..5 {
589-
_ul = self.0[i];
590-
_vl = other.0[i];
589+
_ul = self.0[i];
590+
_vl = other.0[i];
591591

592-
gt_i = _ul > _vl;
593-
eq_i = _ul == _vl;
592+
gt_i = _ul > _vl;
593+
eq_i = _ul == _vl;
594594

595-
c_gt = gt_i || (eq_i & c_gt);
595+
c_gt = gt_i || (eq_i & c_gt);
596596
}
597597

598598
Choice::from(c_gt as u8)

curve25519-dalek/src/field.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,9 @@ impl ConstantTimeGreater for FieldElement {
313313
/// If self > other return Choice(1), otherwise return Choice(0)
314314
///
315315
fn ct_gt(&self, other: &FieldElement) -> Choice {
316-
317-
// One possible failure for is if self.or other falls in 0..18
316+
// One possible failure for is if self or other falls in 0..18
318317
// as s+p in 2^255-19..2^255-1. We can check this by
319-
// converting to bytes and then back to FieldElement,
318+
// converting to bytes and then back to FieldElement,
320319
// since our encoding routine is canonical the returned value
321320
// will always be compared properly.
322321
let a = FieldElement::from_bytes(&self.as_bytes());
@@ -520,11 +519,13 @@ mod test {
520519
// 2^255 - 1 = 18
521520
let low_high_val = <[u8; 32]>::from_hex(
522521
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
523-
).expect("should never fail");
522+
)
523+
.expect("should never fail");
524524
// 32
525525
let higher_low_val = <[u8; 32]>::from_hex(
526526
"0000000000000000000000000000000000000000000000000000000000000020",
527-
).expect("should never fail");
527+
)
528+
.expect("should never fail");
528529

529530
let cases = [
530531
(FieldElement::ONE, FieldElement::ZERO, true),

0 commit comments

Comments
 (0)