Browse Source

Change variable name p503 -> p

master
Henry Case 5 years ago
parent
commit
7730444a0e
2 changed files with 4 additions and 4 deletions
  1. +1
    -1
      p503/consts.go
  2. +3
    -3
      p503/fp.go

+ 1
- 1
p503/consts.go View File

@@ -8,7 +8,7 @@ const (
// Used internally by this package
// -------------------------------

var p503 = Fp{
var p = Fp{
0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xABFFFFFFFFFFFFFF,
0x13085BDA2211E7A0, 0x1B9BF6C87B7E7DAF, 0x6045C6BDDA77A4D0, 0x004066F541811E1E,
}


+ 3
- 3
p503/fp.go View File

@@ -50,14 +50,14 @@ func fpSubRdc(z, x, y *Fp) {
func fpRdcP(x *Fp) {
var borrow, mask uint64
for i := 0; i < FP_WORDS; i++ {
x[i], borrow = bits.Sub64(x[i], p503[i], borrow)
x[i], borrow = bits.Sub64(x[i], p[i], borrow)
}

// Sets all bits if borrow = 1
mask = 0 - borrow
borrow = 0
for i := 0; i < FP_WORDS; i++ {
x[i], borrow = bits.Add64(x[i], p503[i]&mask, borrow)
x[i], borrow = bits.Add64(x[i], p[i]&mask, borrow)
}
}

@@ -176,7 +176,7 @@ func fp2Sub(z, x, y *FpX2) {
mask = 0 - borrow
borrow = 0
for i := FP_WORDS; i < 2*FP_WORDS; i++ {
z[i], borrow = bits.Add64(z[i], p503[i-FP_WORDS]&mask, borrow)
z[i], borrow = bits.Add64(z[i], p[i-FP_WORDS]&mask, borrow)
}
}



Loading…
Cancel
Save