So I'm going to get right to the point asking what I need to know. I'll explain the reasoning below. I am new to c++ and not very accustomed to unions and structures yet. I'm not sure if this can be done but this is what I am trying to do.
I want to create a union which will have the following members
1. a character array of a size to be later declared
2. a two dimensional array created to divide the first array in to 512-bit blocks
3. an array of 32-bit words within each of the blocks
is this possible?
So far I have managed to create a character array of (N * 512) bits containing the padded message. It seems to me that the most efficient way is with pointers to each 512 bit block and each 32 bit word.
Yes. Any object may be examined as a sequence of bytes.
And for a complete object of a trivially copyable type, the underlying bytes making up the object can be copied into and later restored from an array of bytes.