add signing

This commit is contained in:
Pieter Wuille
2013-03-18 02:41:01 +01:00
parent 607884fc11
commit 0a07e62f6f
12 changed files with 121 additions and 6 deletions

View File

@@ -58,6 +58,10 @@ void Number::SetBytes(const unsigned char *bin, unsigned int len) {
mpz_import(bn, len, 1, 1, 1, 0, bin);
}
bool Number::CheckBit(int pos) const {
return mpz_tstbit(bn, pos);
}
void Number::GetBytes(unsigned char *bin, unsigned int len) {
unsigned int size = (mpz_sizeinbase(bn,2)+7)/8;
assert(size <= len);