Improved performance of the safe prime generator #9
@@ -2,7 +2,6 @@ package paillier
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"math/big"
|
"math/big"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -77,18 +76,18 @@ func TestAsyncGenerator(t *testing.T) {
|
|||||||
t.Errorf("2q + 1 != p")
|
t.Errorf("2q + 1 != p")
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(p.Bytes()) != test.bitLen {
|
if p.BitLen() != test.bitLen {
|
||||||
fmt.Errorf(
|
t.Fatalf(
|
||||||
"Unexpected p bit length\nActual: %v\nExpected: %v",
|
"Unexpected p bit length\nActual: %v\nExpected: %v",
|
||||||
len(p.Bytes()),
|
p.BitLen(),
|
||||||
test.bitLen,
|
test.bitLen,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(q.Bytes()) != test.bitLen-1 {
|
if q.BitLen() != test.bitLen-1 {
|
||||||
fmt.Errorf(
|
t.Fatalf(
|
||||||
"Unexpected q bit length\nActual: %v\nExpected: %v",
|
"Unexpected q bit length\nActual: %v\nExpected: %v",
|
||||||
len(q.Bytes()),
|
q.BitLen(),
|
||||||
test.bitLen-1,
|
test.bitLen-1,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user