Ekultek / Dagon

Advanced Hash Manipulation
172 stars 54 forks source link

MD2 algorithm takes up A LOT of CPU usage #70

Open Ekultek opened 7 years ago

Ekultek commented 7 years ago

MD2 algorithm takes up a ton of CPU, 100% on one of my cores on my machine image: dagon-cpu My assumption is that the issue is probably here:

    def digest(self):
        buf = pad(self.buf, self.digest_size)
        c = list(self.c)
        checksum(c, buf)
        #print "*** checksum after padding = ", hexstr(c)
        d = list(self.d)
        digest(d, buf)
        digest(d, c)
        return d[0:16]

There's a lot of recursion here, so I'm going to look into making the MD2 algorithm much faster.