> i had number of 512 bits and i have to calculate modulus of that with 2^256(2 raise power 256).
> I had stored that no of 512 bits in an array of 16 locations.
To get the mod result as an array, take the least significant 8 locations of the array.
To get the mod result as a number, use a large integer library.
Take the least significant 8 locations of the array and form the number by shifting and adding.