I have function A that only spits out arbitrary amount of byte (on range of 0x10 to 0x80), and function B that allows me to pass data only in 0x100 byte.
The solution that I could think of is an array that contains value from function A, it will concat the data as time goes until length of 0x100 is reached, call function B and pass 0x100 byte of data. Once function B finishes, shift the data in array via memcpy (so value from 0x100 index now starts from 0x0). And goes back to function A to get more data.
But I think this would be inefficient due to memcpy operation. Perhaps there is a way to solve this issue more efficiently? Or is there a term for this issue/solution that I could look for?
is this a place where memmove would do it better? mememove safely moves data around in overlapping blocks, for example if you want to get rid of the first element in an array by moving all the others up one spot.