topic Re: working on hashing algorithm SHA-2 in NiosĀ® II Embedded Design Suite (EDS)
https://community.intel.com/t5/Nios-II-Embedded-Design-Suite/working-on-hashing-algorithm-SHA-2/m-p/176926#M43734
<P>I implemented SHA-512, and I don't really get what you don't understand in the description. The message must be padded with a '1' bit, then enough '0' bits, and finally a 64-bit value which indicates the message length in bits. This is also what is described on this wikipedia page (<A href="https://en.wikipedia.org/wiki/sha-2">https://en.wikipedia.org/wiki/sha-2</A>). When they say "append length of message (without the '1' bit or padding)", it means that the length value is the length of your message without the padding bits, it doesn't mean that you don't add the padding bits themselves to the last data word.</P>Fri, 14 Mar 2014 20:40:09 GMTAltera_Forum2014-03-14T20:40:09Zworking on hashing algorithm SHA-2
https://community.intel.com/t5/Nios-II-Embedded-Design-Suite/working-on-hashing-algorithm-SHA-2/m-p/176925#M43733
<P>I am working on implementing the hashing algorithm SHA-2(256) , while working on the algorithm I faced some problems on the padding section, actually according to the algo provided by wikipedia shows the length appending to be done without appending the 1 bit or 0x80 or the padding at the end of the message which is inconsistent with the SHA-1. </P><P></P> <P></P>If anyone has worked on the SHA-2(256) can you pls guide me? I am totally lost.Fri, 14 Mar 2014 13:57:51 GMThttps://community.intel.com/t5/Nios-II-Embedded-Design-Suite/working-on-hashing-algorithm-SHA-2/m-p/176925#M43733Altera_Forum2014-03-14T13:57:51ZRe: working on hashing algorithm SHA-2
https://community.intel.com/t5/Nios-II-Embedded-Design-Suite/working-on-hashing-algorithm-SHA-2/m-p/176926#M43734
<P>I implemented SHA-512, and I don't really get what you don't understand in the description. The message must be padded with a '1' bit, then enough '0' bits, and finally a 64-bit value which indicates the message length in bits. This is also what is described on this wikipedia page (<A href="https://en.wikipedia.org/wiki/sha-2">https://en.wikipedia.org/wiki/sha-2</A>). When they say "append length of message (without the '1' bit or padding)", it means that the length value is the length of your message without the padding bits, it doesn't mean that you don't add the padding bits themselves to the last data word.</P>Fri, 14 Mar 2014 20:40:09 GMThttps://community.intel.com/t5/Nios-II-Embedded-Design-Suite/working-on-hashing-algorithm-SHA-2/m-p/176926#M43734Altera_Forum2014-03-14T20:40:09ZRe: working on hashing algorithm SHA-2
https://community.intel.com/t5/Nios-II-Embedded-Design-Suite/working-on-hashing-algorithm-SHA-2/m-p/176927#M43735
<P> </P><P></P> --- Quote Start --- <P></P>I implemented SHA-512, and I don't really get what you don't understand in the description. The message must be padded with a '1' bit, then enough '0' bits, and finally a 64-bit value which indicates the message length in bits. This is also what is described on this wikipedia page (<A href="https://en.wikipedia.org/wiki/sha-2">https://en.wikipedia.org/wiki/sha-2</A>). When they say "append length of message (without the '1' bit or padding)", it means that the length value is the length of your message without the padding bits, it doesn't mean that you don't add the padding bits themselves to the last data word. <P></P> --- Quote End --- <P></P> <P></P>I know what you said, my question is when i append the value of the message will it always have to be a separate 512 bit data sequence starting with 0s or we can append the length where we are doing the padding, if the space is available at the end of the 512 bit , like we do in sha-1.Fri, 14 Mar 2014 23:16:01 GMThttps://community.intel.com/t5/Nios-II-Embedded-Design-Suite/working-on-hashing-algorithm-SHA-2/m-p/176927#M43735Altera_Forum2014-03-14T23:16:01ZRe: working on hashing algorithm SHA-2
https://community.intel.com/t5/Nios-II-Embedded-Design-Suite/working-on-hashing-algorithm-SHA-2/m-p/176928#M43736
<P>When you cut your data in words of 512 bits, if you have enough unused bits in the last word (65 or more) then you don't need to add a separate 512-bit word. Just pad that last data word with the '1', if necessary some '0's, and the 64-bit length value.</P>Mon, 17 Mar 2014 19:22:13 GMThttps://community.intel.com/t5/Nios-II-Embedded-Design-Suite/working-on-hashing-algorithm-SHA-2/m-p/176928#M43736Altera_Forum2014-03-17T19:22:13Z