How do i use BIGNUM's from the openSSL module in Lazarus
Background:I am working on an encryption application, i have the app written in Objective C and now i want to rewrite it in pascal so that it runs on windows. I am using pascal as it is a language i already know and lazarus as it is a free IDE
Question: How do i use the BigNum module from openSSL in lazarus, i have downloaded this unit: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packages/openssl/src/
and i've put it in
uses openssl;
However when i try and declare a BIGNUM
procedure Tform3.Button1Click(Sender: TObject);
var bits:integer;
p:BIGNUM;
begin
bits:=512;
p:=BN_new();
BN_generate_prime(p, bits, FALSE, NULL, NULL, NULL, NULL);
end;
I just get an error: Error: Identifier not found "BIGNUM"
How do开发者_JS百科 i use the BigNum module and the BN_generate prime(module)?
The unit you are using is an import unit for three DLLs, and one of them is libeay32.dll. But unfortunately, it does not fully import all functions from libeay32.dll. It omits, for instance, the BIGNUM
part, i.e. what you are looking for.
Perhaps you can find a better import unit, like this unit called libeay32.pas, which seems to have all the BN_
functions or you can get the header from this link and add the missing functions to openssl.pas. That is not trivial, but also not undoable. I would go for the ready translated unit. It looks good. The website seems to have a few more things you might need.
精彩评论