Review and changes from Jocelyn Fiat

those invariant are not part of the .._DIGEST_DATA class .. or as postcontion of analyze_digest
much easier to write and read, and localized on digest related code.