pgprandompool.pas

来自「用DELPHI实现的 PGP 加密算法」· PAS 代码 · 共 70 行

PAS
70
字号
{$J+,Z4}
unit pgpRandomPool;

{**********************************************************************************}
{                                                                                  }
{ The contents of this file are subject to the Mozilla Public License Version 1.1  }
{ (the "License"); you may not use this file except in compliance with the         }
{ License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.    }
{                                                                                  }
{ Software distributed under the License is distributed on an "AS IS" basis,       }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the }
{ specific language governing rights and limitations under the License.            }
{                                                                                  }
{ The Original Code is the "Borland Delphi Runtime Library PGPsdk" released 10 Apr }
{ 2000, available at http://www.oz.net/~srheller/dpgp/sdk/.                        }
{                                                                                  }
{ The Initial Developer of the Original Code is Steven R. Heller.                  }
{                                                                                  }
{ Portions created by Steven R. Heller are Copyright (C) 2000 Steven R. Heller.    }
{ All Rights Reserved.                                                             }
{                                                                                  }
{ Contributor(s): Michael in der Wiesche <idw.doc@t-online.de> ("idw"),            }
{ Graham Grieve from Kestral Computing <http://www.kestral.com.au/devtools/pgp/>   }
{                                                                                  }
{ The original file is pgpPubTypes.pas based on pgpPubTypes.h from the PGP sources }
{ which are Copyright (C) Network Associates Inc. and affiliated companies.        }
{                                                                                  }
{ Modifications by "idw" (other than stated in the code below):                    }
{                                                                                  }
{ Comments removed                                                                 }
{                                                                                  }
{**********************************************************************************}

interface

uses
  pgpBase,
  pgpPubTypes;

var
  PGPGlobalRandomPoolAddMouse: function (X: PGPUInt32; Y: PGPUInt32): PGPUInt32; cdecl;
  PGPGlobalRandomPoolAddKeystroke: function(Event: PGPInt32): PGPUInt32; cdecl;
  PGPGlobalRandomPoolAddSystemState: function: PGPError; cdecl;
  PGPGlobalRandomPoolMouseMoved: function: PGPUInt32; cdecl;
  PGPGlobalRandomPoolGetSize: function: PGPUInt32; cdecl;
  PGPGlobalRandomPoolGetEntropy: function: PGPUInt32; cdecl;
  PGPGlobalRandomPoolGetMinimumEntropy: function: PGPUInt32; cdecl;
  PGPGlobalRandomPoolHasMinimumEntropy: function: PGPBoolean; cdecl;

implementation	// code modified by idw

uses
  Windows;

initialization

  if PGPInitErrorCode=ieNone then begin
    PGPGlobalRandomPoolAddMouse:=GetProcAddress(hPGPsdkLib, 'PGPGlobalRandomPoolAddMouse');
    PGPGlobalRandomPoolAddKeystroke:=GetProcAddress(hPGPsdkLib, 'PGPGlobalRandomPoolAddKeystroke');
    PGPGlobalRandomPoolAddSystemState:=GetProcAddress(hPGPsdkLib, 'PGPGlobalRandomPoolAddSystemState');
    PGPGlobalRandomPoolMouseMoved:=GetProcAddress(hPGPsdkLib, 'PGPGlobalRandomPoolMouseMoved');
    PGPGlobalRandomPoolGetSize:=GetProcAddress(hPGPsdkLib, 'PGPGlobalRandomPoolGetSize');
    PGPGlobalRandomPoolGetEntropy:=GetProcAddress(hPGPsdkLib, 'PGPGlobalRandomPoolGetEntropy');
    PGPGlobalRandomPoolGetMinimumEntropy:=GetProcAddress(hPGPsdkLib, 'PGPGlobalRandomPoolGetMinimumEntropy');
    PGPGlobalRandomPoolHasMinimumEntropy:=GetProcAddress(hPGPsdkLib, 'PGPGlobalRandomPoolHasMinimumEntropy');
  end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?