Skip to content
Snippets Groups Projects
Commit 4eb1b87e authored by akwizgran's avatar akwizgran
Browse files

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

parent af28e28c
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ class Sec1KeyParser implements KeyParser { ...@@ -28,7 +28,7 @@ class Sec1KeyParser implements KeyParser {
this.params = params; this.params = params;
this.modulus = modulus; this.modulus = modulus;
this.keyBits = keyBits; this.keyBits = keyBits;
bytesPerInt = keyBits + 7 / 8; bytesPerInt = (keyBits + 7) / 8;
publicKeyBytes = 1 + 2 * bytesPerInt; publicKeyBytes = 1 + 2 * bytesPerInt;
privateKeyBytes = bytesPerInt; privateKeyBytes = bytesPerInt;
} }
......
...@@ -11,7 +11,7 @@ class Sec1PrivateKey implements PrivateKey { ...@@ -11,7 +11,7 @@ class Sec1PrivateKey implements PrivateKey {
Sec1PrivateKey(ECPrivateKeyParameters key, int keyBits) { Sec1PrivateKey(ECPrivateKeyParameters key, int keyBits) {
this.key = key; this.key = key;
bytesPerInt = keyBits + 7 / 8; bytesPerInt = (keyBits + 7) / 8;
} }
public byte[] getEncoded() { public byte[] getEncoded() {
......
...@@ -16,7 +16,7 @@ class Sec1PublicKey implements PublicKey { ...@@ -16,7 +16,7 @@ class Sec1PublicKey implements PublicKey {
Sec1PublicKey(ECPublicKeyParameters key, int keyBits) { Sec1PublicKey(ECPublicKeyParameters key, int keyBits) {
this.key = key; this.key = key;
bytesPerInt = keyBits + 7 / 8; bytesPerInt = (keyBits + 7) / 8;
publicKeyBytes = 1 + 2 * bytesPerInt; publicKeyBytes = 1 + 2 * bytesPerInt;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment