Make sure public key bit length is an even number

For an odd n-bit number, we can't find two n-1-bit numbers which
multiplied gives an n-bit number. That's why public key length n must be
an even number.

I have also renamed AreSafePrimes to IsSafePrime since only the first
function argument is considered to be a safe prime according to a safe
prime definition.
This commit is contained in:
Piotr Dyraga committed 2018-08-08 11:11:05 +02:00
1 parent d5973f86a7
commit 12b3dadef7
4 files changed
+26 -10

No files matched your search

+1 -1
View File
@@ -60,7 +60,7 @@ func TestAsyncGenerator(t *testing.T) {
t.Fatal(err)
}
AreSafePrimes(p, q, test.bitLen, t)
IsSafePrime(p, q, test.bitLen, t)
}
})
}