misc/76106: Invalid hash-value is output by the `digest' command
with sha256 mode.
morioka at openloop.co.jp
Tue Jan 11 08:10:31 PST 2005
>Synopsis: Invalid hash-value is output by the `digest' command with sha256 mode.
>Arrival-Date: Tue Jan 11 16:10:30 GMT 2005
>Originator: Kenichi Morioka
>Release: 4-10 RELEASE
FreeBSD gw1 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Tue Oct 12 08:45:15 JST 2004 root at gw1:/usr/src/sys/compile/GATEWAY-001
When inputting a file including 54-byte data, the digest command output invalid hash value.
(where, the input data size is 55-byte as including return code(0x0a).)
In a word, when inputting the 55-byte message data to sha256, output value is invalid.
Such a result is only when using 55-byte input data.
When a file including 54-byte(size of that final data becomes 55-byte) is input to `digest' in sha256-mode.
I think that it is good to correct `the 64-byte message block generator' in sha256 (SHA256_Update() or SHA256_Final() in sha2.c).
(I think that this cause of this problem is not the implementation of sha256 transform alogorithm but the process of input message block.)
Because that the message of 55-bytes is the values that become just 64 bytes when `the message terminator code(0x80)' and `size-field(8-byte)' are added.
Perhaps, I think this block of a lot of one be made at this time.
More information about the freebsd-bugs