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:
4 files changed
+26
-10
No files matched your search
@@ -60,7 +60,7 @@ func TestAsyncGenerator(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
AreSafePrimes(p, q, test.bitLen, t)
|
||||
IsSafePrime(p, q, test.bitLen, t)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user