Fixed a moronic arithmetic mistake that was causing key parsing errors.

This commit is contained in:
akwizgran
2014-01-05 22:31:35 +00:00
parent af28e28cd9
commit 4eb1b87ed1
3 changed files with 3 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ class Sec1KeyParser implements KeyParser {
this.params = params;
this.modulus = modulus;
this.keyBits = keyBits;
bytesPerInt = keyBits + 7 / 8;
bytesPerInt = (keyBits + 7) / 8;
publicKeyBytes = 1 + 2 * bytesPerInt;
privateKeyBytes = bytesPerInt;
}

View File

@@ -11,7 +11,7 @@ class Sec1PrivateKey implements PrivateKey {
Sec1PrivateKey(ECPrivateKeyParameters key, int keyBits) {
this.key = key;
bytesPerInt = keyBits + 7 / 8;
bytesPerInt = (keyBits + 7) / 8;
}
public byte[] getEncoded() {

View File

@@ -16,7 +16,7 @@ class Sec1PublicKey implements PublicKey {
Sec1PublicKey(ECPublicKeyParameters key, int keyBits) {
this.key = key;
bytesPerInt = keyBits + 7 / 8;
bytesPerInt = (keyBits + 7) / 8;
publicKeyBytes = 1 + 2 * bytesPerInt;
}