time ellapse to sign string with RSA

Hi,

I buyed the crypto pack to sign a string with RSA 2048, but it take 1 seconde for that. I'm surprised.
I tested the same thing in c# and it it's instant.

Can you help me to increase the speed?

my code like that :

var
   modulus, publicExponent, privateExponent:AnsiString;
   Conv: TConvert;
begin
    modulus:=  '..... INIT .....'
    publicExponent:='....'
    privateExponent:='...';

    Conv:=TConvert.Create();
    Conv.AType := base64url;

    RSA:= TRSAEncSign.Create(nil);
    RSA.KeyLength := kl2048;
    RSA.OutputFormat := base64url;
    RSA.Unicode := yesUni;
    RSA.Modulus := Conv.KeyRSAOpenSSLToKeyTRSAEncSign(modulus);
    RSA.PublicExponent := Conv.KeyRSAOpenSSLToKeyTRSAEncSign(publicExponent);
    RSA.PrivateExponent := Conv.KeyRSAOpenSSLToKeyTRSAEncSign(privateExponent);

    RSA.signType := TRSASignType.pss;
    Conv.Free;
    RSA.Sign('string to sign');



Hi, 

On which platform do you execute this code? 
Best regards,
Marion

Hi,


I execute this code on windows 10 with delphi XE3.

thank for your interest

So, on Win32 platform?

Marion

Yes, Win32 platform

Our library uses compiled C code to embed cryptography algorithms. On Win32 platform, we use C++ Builder to compile the code and optimizations are not as good as the ones from Visual Studio we use on Win64 platform. 

You can increase the speed by putting RSA.constantTime := false; it takes 750 ms to sign a string. 
Best regards,
Marion
OK, I will change my code like you indicate me.
If I change the platform to win64, my code will be faster?

Yes, on Win64 platform, the signature takes approximately 190 ms to perform (on my computer) comparing to 750 ms on Win32 platform.

Best regards,
Marion

OK. thank you for your responses.