OP_CHECKSIG

OP_CHECKSIG now works with at least the trivial pay-to-pubkey script.
OP_CHECKMULTISIG not yet tested.
Interpreter -> Interp

"Interpreter" was such a long name that it was annoying to type. "Interp" is
easier.
add unworking (but skipped) test from script_valid

This test doesn't work, indicating something is possibly wrong with the
interpreter. What's actually probably wrong is the way I'm creating the two
transactions. But who knows. I'm adding this test now since I have other things
I want to do and would rather commit the broken test (albeit skipped) to the
repo while I fix misc. other things.
CScriptNum

bitcoind has a class called CScriptNum which is used to handle numbers in the
stack when a script is executed. These are interpreted as 4 byte, SM-encoded
little endian numbers. There is important feature that distinguishes them from
normal 4 byte numbers - they can overflow. Thus, internally, they are
represented as 8 byte numbers. When overflowed and output, the overflowed value
is output. Thus the output can be longer than 4 bytes. However, you can not
perform operations on numbers over 4 bytes (nMaxNumSize). If you do, an
exception is thrown. Thus, if an overflow occurs and you output an overflowed
number, that's fine, but if you try to operate on it again, that's not fine.

I have implemented this in fullnode by adding the fromCScriptNumBuffer and
toCScriptNumBuffer functions. These will be used in the interpreter.
use to/from CScriptNumBuffer

If the number being input is greater than 4 bytes, an exception should be
thrown. This is explained in the CScriptNum comments in bitcoind. As explained
in the previous commit, I have added this functionality to fullnode in the BN
class by adding to/from CScriptNumBuffer functions. Here I simply update the
interpreter to use them. This should increase the correctness of the
interpreter. For instance, if a script tries to perform a number operation on a
5 byte value, that will now throw an error, as it should.
should use castToBool here
introductory comment
reformat test

...so that it is more like the test that fails to aid in debugging.
fix CHECKSIG by correcting endiannes of hashbuf

bitcoin assumes hash is little endian before converting it to the e value used
in ECDSA. I had been using big endian, and this is why the test was broken.
Since the ECDSA class is specific to bitcoin, I should probably update the
default from big endian to little endian. But for now, the default is still big
endian, and the option of little endian is available for signing/verifying
transactions.
simplify interpreter tests slightly
fix exposure of interpreter