Ugochukwu Mmaduekwe 4 дней назад
Родитель
Сommit
c46aa83993

+ 1 - 1
CryptoLib.Tests/src/Math/ECPointTests.pas

@@ -281,7 +281,7 @@ end;
 
 procedure TTestECPoint.AssertIFiniteFieldsEqual(const a, b: IFiniteField);
 begin
-  CheckEquals(True, (a as TObject).Equals(b as TObject));
+  CheckEquals(True, a.Equals(b));
 end;
 
 procedure TTestECPoint.AssertOptionalValuesAgree(const a, b: TBigInteger);

+ 2 - 0
CryptoLib/src/Math/Field/ClpPrimeField.pas

@@ -67,6 +67,8 @@ function TPrimeField.Equals(const AOther: IFiniteField): Boolean;
 begin
   if AOther = nil then
     Exit(False);
+  if (Self as IFiniteField) = AOther then
+    Exit(True);
   Result := FCharacteristic.Equals(AOther.Characteristic);
 end;