padding algorithm more than 512 bits in sha256
if anyone answered my quesion i would be very much grateful, my question is in sha256 , if we have 512 bits message length how can i do padding , because in sha256 l+1+k=448mod512, it will overflow 512 bit block, i mean to say that for hashing computation we need to divide 512 bit block into 16 x 32 blocks , and the process is the message bit length (l) + k number of '0' + binary representation of l(length of message). my point is 512 bit after k number 0f '0' and bit representation of l(length of message) we will get more than 512 bits , how ae we going to divide into 16 x 32 bit blocks.
You don't need to pad your data to be a certain length in order to get a sha256 checksum value; the algorithm will handle a few bytes as well as megabytes of data:
Linux> echo 'hey' | sha256sum 4e955fea0268518cbaa500409dfbec88f0ecebad28d84ecbe250baed97dba889 - Linux> echo '' | sha256sum 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b - Linux> ls -oh L0_2018_08_28_Disk1_8mtbno4o_3_1.bkp -rw-r-----. 1 nfsnobody 348M Aug 28 23:48 L0_2018_08_28_Disk1_8mtbno4o_3_1.bkp Linux> sha256sum L0_2018_08_28_Disk1_8mtbno4o_3_1.bkp 34438a1bc45f613b7be8797b1139aaa66a60d73844f2d7554184b17c621b4576 L0_2018_08_28_Disk1_8mtbno4o_3_1.bkp
If you want to learn about the actual algorithm, one open-source implementation says
Algorithm specification can be found here: http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf