I have to admit that I know nothing about nimSHA2 module. But a very short look 
at your code shows:
    
    
    while bytesRead > 0:
      sha.update($buffer)
    

So my feeling is, that you always call update() on the full buffer, even when 
only a part of the buffer is actually read. I may be wrong, but I have the 
feeling that that should not work in the general case. How does sha.update() 
discover actual buffer size? By zero byte? And what when data contains zero?

Reply via email to