]> git.tdb.fi Git - libs/crypto.git/commitdiff
Remove useless programmatical filling of MD5::rotate_table
authorMikko Rasa <tdb@tdb.fi>
Sat, 16 Apr 2016 10:57:29 +0000 (13:57 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 16 Apr 2016 10:59:04 +0000 (13:59 +0300)
The table is so small that static initialization is easier, and in fact
the initializer is already there so the code wasn't even run.

source/md5.cpp

index c989526e03ac515466a5fd55472ff0dabe82bc03..1fe700305bee89f5f801d4bbcda323e6aef7290e 100644 (file)
@@ -82,18 +82,6 @@ void MD5::init()
        if(!sin_table[0])
                for(unsigned i=0; i<64; ++i)
                        sin_table[i] = 4294967296.0*abs(sin((i+1)*1.0));
-
-       if(!rotate_table[0])
-       {
-               for(unsigned i=0; i<4; ++i)
-                       rotate_table[i] = 7+i*5;
-               for(unsigned i=0; i<4; ++i)
-                       rotate_table[4+i] = 5+i*4+i*i/3;
-               for(unsigned i=0; i<4; ++i)
-                       rotate_table[8+i] = 4+i*7;
-               for(unsigned i=0; i<4; ++i)
-                       rotate_table[12+i] = 6+i*4+i*i/3;
-       }
 }
 
 void MD5::update(const char *data, unsigned len)