Skip to main content
Mod Moved Comments To Chat
Post Reopened by e-sushi
deleted 47 characters in body; edited tags
Source Link
e-sushi
  • 18.1k
  • 12
  • 85
  • 235

How exactly is the input message of SHA-256 Message pre(pre-processing)processed?

ImI’m very interested how SHA-256 handles messages, but iI’ve got 3 questions.(As I have already read in some answers before, sha 256 is not directly performed on the message but on an array, thanks for that) (As I have already read in some answers before, SHA-256 is not directly performed on the message but on an array, thanks for that.)

  1. In my understanding after padding the message to a multiple of 512 bit length, we put the message into a 64 entry message schedule array w[0..63] of 32-bit words. So is this an array with 64 elements, each allowed to be 32 bits long?

  2. copy chunk into first 16 words w[0..15] of the message schedule array But then i ask myself, if we have a message that is, for example 4096 bits long and we only fill the first 16 elements of the array with the original message what happens to the other (4096-16*32 = 3584) 3584 bits of the message?

  3. s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3) What are the rightrotate and rightshift operators doing to the elements in the array?

    In my understanding after padding the message to a multiple of 512 bit length, we put the message into a

64 entry message schedule array w[0..63] of 32-bit words

ThanksIs this an array with 64 elements, each allowed to be 32 bits long?

  1. copy chunk into first 16 words w[0..15] of the message schedule array

But then I ask myself, if we have a message that is, for example 4096 bits long and we only fill the answers already givenfirst 16 elements of the array with the original message, what happens to the other (4096-16*32 = 3584) 3584 bits of the message? 3. > s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3)

What are the rightrotate and rightshift operators doing to the elements in the previous questionarray?

SHA-256 Message pre-processing

Im very interested how SHA-256 handles messages, but i got 3 questions.(As I have already read in some answers before, sha 256 is not directly performed on the message but on an array, thanks for that)

  1. In my understanding after padding the message to a multiple of 512 bit length, we put the message into a 64 entry message schedule array w[0..63] of 32-bit words. So is this an array with 64 elements, each allowed to be 32 bits long?

  2. copy chunk into first 16 words w[0..15] of the message schedule array But then i ask myself, if we have a message that is, for example 4096 bits long and we only fill the first 16 elements of the array with the original message what happens to the other (4096-16*32 = 3584) 3584 bits of the message?

  3. s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3) What are the rightrotate and rightshift operators doing to the elements in the array?

Thanks for the answers already given, in the previous question

How exactly is the input message of SHA-256 (pre-)processed?

I’m very interested how SHA-256 handles messages, but I’ve got 3 questions. (As I have already read in some answers before, SHA-256 is not directly performed on the message but on an array, thanks for that.)

  1. In my understanding after padding the message to a multiple of 512 bit length, we put the message into a

64 entry message schedule array w[0..63] of 32-bit words

Is this an array with 64 elements, each allowed to be 32 bits long?

  1. copy chunk into first 16 words w[0..15] of the message schedule array

But then I ask myself, if we have a message that is, for example 4096 bits long and we only fill the first 16 elements of the array with the original message, what happens to the other (4096-16*32 = 3584) 3584 bits of the message? 3. > s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3)

What are the rightrotate and rightshift operators doing to the elements in the array?

Maarten Bodewes advised me to change the question
Source Link

SHA-256 procedureMessage pre-processing

Can sombody explain meIm very interested how SHA 256 actually wokrs-256 handles messages, but i got 3 questions. Wikipedia writes(As I have already read in some answers before, sha 256 is not directly performed on the message but on an array, thanks for that)

Pre-processing:
begin with the original message of length L bits
append a single '1' bit
append K '0' bits, where K is the minimum number >= 0 such that L + 1 + K + 64 is a multiple of 512
append L as a 64-bit big-endian integer, making the total post-processed length a multiple of 512 bits
Process the message in successive 512-bit chunks:
break message into 512-bit chunks
for each chunk
    create a 64-entry message schedule array w[0..63] of 32-bit words
    (The initial values in w[0..63] don't matter, so many implementations zero them here)
    copy chunk into first 16 words w[0..15] of the message schedule array
    Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array:
    for i from 16 to 63
        s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3)
        s1 := (w[i-2] rightrotate 17) xor (w[i-2] rightrotate 19) xor (w[i-2] rightshift 10)
        w[i] := w[i-16] + s0 + w[i-7] + s1

Can somone give an example how this works.

  1. In my understanding after padding the message to a multiple of 512 bit length, we put the message into a 64 entry message schedule array w[0..63] of 32-bit words. So is this an array with 64 elements, each allowed to be 32 bits long?

  2. copy chunk into first 16 words w[0..15] of the message schedule array But then i ask myself, if we have a message that is, for example 4096 bits long and we only fill the first 16 elements of the array with the original message what happens to the other (4096-16*32 = 3584) 3584 bits of the message?

  3. s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3) What are the rightrotate and rightshift operators doing to the elements in the array?

That would helped me a lotThanks for the answers already given, thank you.in the previous question

SHA-256 procedure

Can sombody explain me how SHA 256 actually wokrs. Wikipedia writes

Pre-processing:
begin with the original message of length L bits
append a single '1' bit
append K '0' bits, where K is the minimum number >= 0 such that L + 1 + K + 64 is a multiple of 512
append L as a 64-bit big-endian integer, making the total post-processed length a multiple of 512 bits
Process the message in successive 512-bit chunks:
break message into 512-bit chunks
for each chunk
    create a 64-entry message schedule array w[0..63] of 32-bit words
    (The initial values in w[0..63] don't matter, so many implementations zero them here)
    copy chunk into first 16 words w[0..15] of the message schedule array
    Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array:
    for i from 16 to 63
        s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3)
        s1 := (w[i-2] rightrotate 17) xor (w[i-2] rightrotate 19) xor (w[i-2] rightshift 10)
        w[i] := w[i-16] + s0 + w[i-7] + s1

Can somone give an example how this works.

That would helped me a lot, thank you.

SHA-256 Message pre-processing

Im very interested how SHA-256 handles messages, but i got 3 questions.(As I have already read in some answers before, sha 256 is not directly performed on the message but on an array, thanks for that)

  1. In my understanding after padding the message to a multiple of 512 bit length, we put the message into a 64 entry message schedule array w[0..63] of 32-bit words. So is this an array with 64 elements, each allowed to be 32 bits long?

  2. copy chunk into first 16 words w[0..15] of the message schedule array But then i ask myself, if we have a message that is, for example 4096 bits long and we only fill the first 16 elements of the array with the original message what happens to the other (4096-16*32 = 3584) 3584 bits of the message?

  3. s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3) What are the rightrotate and rightshift operators doing to the elements in the array?

Thanks for the answers already given, in the previous question

Post Closed as "Needs more focus" by e-sushi
Source Link

SHA-256 procedure

Can sombody explain me how SHA 256 actually wokrs. Wikipedia writes

Pre-processing:
begin with the original message of length L bits
append a single '1' bit
append K '0' bits, where K is the minimum number >= 0 such that L + 1 + K + 64 is a multiple of 512
append L as a 64-bit big-endian integer, making the total post-processed length a multiple of 512 bits
Process the message in successive 512-bit chunks:
break message into 512-bit chunks
for each chunk
    create a 64-entry message schedule array w[0..63] of 32-bit words
    (The initial values in w[0..63] don't matter, so many implementations zero them here)
    copy chunk into first 16 words w[0..15] of the message schedule array
    Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array:
    for i from 16 to 63
        s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3)
        s1 := (w[i-2] rightrotate 17) xor (w[i-2] rightrotate 19) xor (w[i-2] rightshift 10)
        w[i] := w[i-16] + s0 + w[i-7] + s1

Can somone give an example how this works.

That would helped me a lot, thank you.