ClpValidityPrecompInfo.pas 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. { *********************************************************************************** }
  2. { * CryptoLib Library * }
  3. { * Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe * }
  4. { * Github Repository <https://github.com/Xor-el> * }
  5. { * Distributed under the MIT software license, see the accompanying file LICENSE * }
  6. { * or visit http://www.opensource.org/licenses/mit-license.php. * }
  7. { * Acknowledgements: * }
  8. { * * }
  9. { * Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring * }
  10. { * development of this library * }
  11. { * ******************************************************************************* * }
  12. (* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
  13. unit ClpValidityPreCompInfo;
  14. {$I ..\..\..\Include\CryptoLib.inc}
  15. interface
  16. uses
  17. ClpIPreCompInfo,
  18. ClpIValidityPreCompInfo;
  19. type
  20. TValidityPreCompInfo = class(TInterfacedObject, IPreCompInfo,
  21. IValidityPreCompInfo)
  22. strict private
  23. var
  24. Ffailed, FcurveEquationPassed, ForderPassed: Boolean;
  25. public
  26. const
  27. PRECOMP_NAME = 'bc_validity';
  28. function HasFailed(): Boolean; inline;
  29. procedure ReportFailed(); inline;
  30. function HasCurveEquationPassed(): Boolean; inline;
  31. procedure ReportCurveEquationPassed(); inline;
  32. function HasOrderPassed(): Boolean; inline;
  33. procedure ReportOrderPassed(); inline;
  34. constructor Create();
  35. end;
  36. implementation
  37. { TValidityPreCompInfo }
  38. constructor TValidityPreCompInfo.Create;
  39. begin
  40. Inherited Create();
  41. Ffailed := False;
  42. FcurveEquationPassed := False;
  43. ForderPassed := False;
  44. end;
  45. function TValidityPreCompInfo.HasCurveEquationPassed: Boolean;
  46. begin
  47. result := FcurveEquationPassed;
  48. end;
  49. function TValidityPreCompInfo.HasFailed: Boolean;
  50. begin
  51. result := Ffailed;
  52. end;
  53. function TValidityPreCompInfo.HasOrderPassed: Boolean;
  54. begin
  55. result := ForderPassed;
  56. end;
  57. procedure TValidityPreCompInfo.ReportCurveEquationPassed;
  58. begin
  59. FcurveEquationPassed := True;
  60. end;
  61. procedure TValidityPreCompInfo.ReportFailed;
  62. begin
  63. Ffailed := True;
  64. end;
  65. procedure TValidityPreCompInfo.ReportOrderPassed;
  66. begin
  67. ForderPassed := True;
  68. end;
  69. end.