On Fri, Apr 15, 2005 at 11:38:47AM -0400, Dustin kirkland wrote: > On 3/25/05, Luciano Miguel Ferreira Rocha <strange@xxxxxxxxxxxxx> wrote: > > I like it! Just one question: why aren't you using the intermediate > > values of the full MD5? > > I've worked with this a little more, taking Luciano's suggestion to > use the running context rather than maintaining a separate fragmd5ctx. > I have it working (attached), but there's a side effect of doing it > this way. > > This version calls MD5_Final() on the md5ctx variable periodically (I > assume that's what you meant--that's the only way I can see to > actually extract a sum string out of a context variable). Each call > to this function will fill a string with an md5 sum, but it also > modifies the md5ctx value in the process. This ultimately results in > a different md5 sum of the whole disc when compared to the original > method where MD5_Final() is only called at the very end of the > computing. Yes, MD5_Final destroys the md5ctx. I imagined MD5 had some function to get the value without destroying the information. Or at the very least an EVP_MD_CTX_copy alike. One option is to create a copy of the md5ctx and do the MD5_Final on that one. But I don't have the time to try that myself, sorry.. Regards, Luciano Rocha