|
Message-ID: <AANLkTik=9dXoR3B+oJP=ctmb2=iKYWere2Ojp-GTCmyg@mail.gmail.com> Date: Thu, 24 Mar 2011 18:01:59 +0100 From: Ćukasz Odzioba <lukas.odzioba@...il.com> To: john-dev@...ts.openwall.com Subject: pow64of32 Hi, i was looking into the JtR sources and found that powering function implementation is not optimal. It is O(n), but we can do that in logarithmic time. It's not a big deal but mayby code listed below, would be better (for the peace of mind). void pow64of32(int64 *dst,unsigned int x,int n) {//O(logn) int64 tmp={0,1}; while(n--){ if(n%2) mul64by32(&tmp,x); x*=x; n/=2; } } pow64of32 function is defined in math.c . Lukas
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.