# How many possible combinations of input files are possible using a 63-bit length?

I'm trying to calculate how many possible combinations of files there can be using a signed 64-bit file length, but can't seem to find a formula (or I'm using the wrong keywords). For example, the number of unique files that have a length of 256 bytes is $2^{256*8}$ = $2^{2048}$. I assume the total number of combinations across all file lengths will be some kind of geometric sequence.

The reason I want to calculate it, is because I'm curious how it relates to the number of possible SHA-256 hashes ($2^{256}$) of all these input files. Also, if I then calculate the SHA-256 hash of the SHA-256 hash of the file contents, how much have I reduced the entropy (if that's the correct term)?

-
 It looks like you did not work on that one hard enough. Some hints follow. You will find the restrictions on the input of SHA-256 in the standard. That does not match the question and title, any way I read length. Worse, there's a clash in the usual meaning of the term. You need to define what length is in your context. – fgrieu Dec 6 '11 at 12:50

For a given file length L bytes the combinations for that length is 256^L. The total combination is the sum of combinations for all file lengths L from zero to (2^63)-1. Just substitute parameters in the formula for summing the n first terms of a geometric series. The rest is left as an exercise to the reader :-)

If all you need is a rough order-of-magnitude estimate it is really sufficient to just look at the highest order term, which provides a quick lower-bound estimate and which will already tells you the ratio is a very large number (very large for cryptographic purposes), which means the factor you have "reduced entropy" is a number very close to zero (once again, for cryptographic purposes).

-