aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/muhash.h
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2021-01-14 01:27:37 +0100
committerFabian Jahr <fjahr@protonmail.com>2021-01-24 16:28:27 +0100
commita1fcceac69097a8e6540a6fd8121a5d53022528f (patch)
tree8636496edd5f9d46bcc77c391a914c18a8ec3d35 /src/crypto/muhash.h
parentcb2c578451770a29395f79f7077c362e1f54dfdd (diff)
downloadbitcoin-a1fcceac69097a8e6540a6fd8121a5d53022528f.tar.xz
refactor: Improve encapsulation between MuHash3072 and Num3072
Also fixes a typo.
Diffstat (limited to 'src/crypto/muhash.h')
-rw-r--r--src/crypto/muhash.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/crypto/muhash.h b/src/crypto/muhash.h
index 0c710007c4..c023a8b9d3 100644
--- a/src/crypto/muhash.h
+++ b/src/crypto/muhash.h
@@ -22,6 +22,7 @@ private:
Num3072 GetInverse() const;
public:
+ static constexpr size_t BYTE_SIZE = 384;
#ifdef HAVE___INT128
typedef unsigned __int128 double_limb_t;
@@ -48,8 +49,10 @@ public:
void Divide(const Num3072& a);
void SetToOne();
void Square();
+ void ToBytes(unsigned char (&out)[BYTE_SIZE]);
Num3072() { this->SetToOne(); };
+ Num3072(const unsigned char (&data)[BYTE_SIZE]);
SERIALIZE_METHODS(Num3072, obj)
{
@@ -78,7 +81,7 @@ public:
* arbitrary subset of the update operations, allowing them to be
* efficiently combined later.
*
- * Muhash does not support checking if an element is already part of the
+ * MuHash does not support checking if an element is already part of the
* set. That is why this class does not enforce the use of a set as the
* data it represents because there is no efficient way to do so.
* It is possible to add elements more than once and also to remove
@@ -91,8 +94,6 @@ public:
class MuHash3072
{
private:
- static constexpr size_t BYTE_SIZE = 384;
-
Num3072 m_numerator;
Num3072 m_denominator;