On Wed, Apr 02, 2025 at 07:42:08PM +0530, T Pratham wrote: > > Thanks! I'm assuming then count[1] will store the digest count in sha512 > here. count[1] contains the upper 64 bits of the 128-bit sha512 counter. > Is this the same for SHA256? Since there the count is not an array, so > is it then count = (digestcnt << 32) & buflen? The sha256 counter is only 64 bits long, so only count[0] gets written out. There is no need to do any shifting for either sha256 or sha512, it should just be: count = digestcnt + buflen; Where digestcnt is a multiple of blocksize and buflen is less than blocksize. Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt