-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 8, 26
-
Component/s: security-libs
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The documentation states the computation of EllipticCurve#hashCode() as
(field.hashCode() << 6) + (a.hashCode() << 4) + (b.hashCode() << 2)
whereas the implementation is
(field.hashCode() << 6 + (a.hashCode() << 4) + (b.hashCode() << 2))
Since operator + takes precedence over << the parentheses matter.
PS: on top of that, the hash code function is atypical, since the lowest 2 bits are not equally distributed.
The documentation states the computation of EllipticCurve#hashCode() as
(field.hashCode() << 6) + (a.hashCode() << 4) + (b.hashCode() << 2)
whereas the implementation is
(field.hashCode() << 6 + (a.hashCode() << 4) + (b.hashCode() << 2))
Since operator + takes precedence over << the parentheses matter.
PS: on top of that, the hash code function is atypical, since the lowest 2 bits are not equally distributed.