Use the bignum library that's part of openssl. check <bn.h>
there are plenty of modulo-exponentation functions, i count 5. -lee -----Original Message----- From: Krzysztof Szkudlarek [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 7:44 AM To: '[EMAIL PROTECTED]' Subject: Speed of calculating (a exp x) modulo n ? Hello to everybody! Could anybody point me to some information about speed of various cryptographic function? How fast are crypto function implemented in OpenSSL. I have recently implemented my own simple function calculating value of a^x%n. If all three values (a,x and n) are 1024 bits long, then computing result on PC with Athlon XP+ 1600 (under Win 2000) takes about 3 seconds (while for 128 bits, it takes about 0.01 second). I know that real applications (like ssh f.e.) which relays on openssl, do it much faster even on slower machines. So, either my code worth nothing, or there are used shorter values and/or any tricks. I want to know which is the case, and if my code is so slow, how could I use crypto function from openssl library? I don't want to open regular SSL session, but just to be able computing value of a^x%n. (any sample code, would be very appreciated :-), but I can't find on the net any suitable documentation and samples. Thanks in advance for any answer. P.S. I'm sory for my bad english. Krzysztof Szkudlarek mailto:[EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]