SHA-256 Hashing problem from binary values
You need to hash exactly 2 bits set to 1. Two bits need to be padded, remembering that this is the last block. In that case the result is correct.

Note that representing two bits with hex value C0 is not correct. C0 represents a full byte and there is no reason to use the most significant bits rather than the lowest significant bits. Two bits set to one should simply be represented as 11 in binary.



I calculated the required result by performing a digest of the value E0 (the value with an additional padding bit set to 1, and the rest 0 valued padding bits: 11 1 0 0000), skipping the usual padding byte 80 (or 1000 0000 in binary), padding with zero valued bytes and then finally setting the (internal, encoded) length to 2. A bit messy, but it works.