diff options
-rw-r--r-- | include/bigint.h | 1 | ||||
-rw-r--r-- | src/big_base.cpp | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/bigint.h b/include/bigint.h index 2fab6645c..44382b063 100644 --- a/include/bigint.h +++ b/include/bigint.h @@ -86,6 +86,7 @@ class BigInt void binary_encode(byte[]) const; void binary_decode(const byte[], u32bit); + void binary_decode(const MemoryRegion<byte>&); u32bit encoded_size(Base = Binary) const; static SecureVector<byte> encode(const BigInt&, Base = Binary); diff --git a/src/big_base.cpp b/src/big_base.cpp index 20d6f4ece..158d967fb 100644 --- a/src/big_base.cpp +++ b/src/big_base.cpp @@ -375,4 +375,12 @@ void BigInt::binary_decode(const byte buf[], u32bit length) reg[length / WORD_BYTES] = (reg[length / WORD_BYTES] << 8) | buf[j]; } +/************************************************* +* Set this number to the value in buf * +*************************************************/ +void BigInt::binary_decode(const MemoryRegion<byte>& buf) + { + binary_decode(buf, buf.size()); + } + } |