@@ -841,6 +841,10 @@ EllipticCurve getCurve() {
841
841
return getParamSpec ().getCurve ();
842
842
}
843
843
844
+ int getBitLength () {
845
+ return getParamSpec ().getOrder ().bitLength ();
846
+ }
847
+
844
848
@ JRubyMethod
845
849
public RubySymbol point_conversion_form (final ThreadContext context ) {
846
850
return context .runtime .newSymbol (this .conversionForm .toRubyString ());
@@ -900,7 +904,6 @@ public Point(Ruby runtime, RubyClass type) {
900
904
}
901
905
902
906
private ECPoint point ;
903
- //private int bitLength;
904
907
private Group group ;
905
908
906
909
Point (Ruby runtime , ECPublicKey publicKey , Group group ) {
@@ -978,11 +981,6 @@ private ECPoint asECPoint() {
978
981
return point ; // return publicKey.getW();
979
982
}
980
983
981
- private int bitLength () {
982
- assert group != null ;
983
- return group .getParamSpec ().getOrder ().bitLength ();
984
- }
985
-
986
984
private PointConversion getPointConversionForm () {
987
985
if (group == null ) return null ;
988
986
return group .conversionForm ;
@@ -1007,7 +1005,8 @@ private byte[] encodePoint(final PointConversion conversionForm) {
1007
1005
final byte [] encoded ;
1008
1006
switch (conversionForm ) {
1009
1007
case UNCOMPRESSED :
1010
- encoded = encodeUncompressed (bitLength (), point );
1008
+ assert group != null ;
1009
+ encoded = encodeUncompressed (group .getBitLength (), point );
1011
1010
break ;
1012
1011
case COMPRESSED :
1013
1012
encoded = encodeCompressed (point );
0 commit comments