File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -573,6 +573,15 @@ MuHash3072& MuHash3072::operator/=(const MuHash3072& div) noexcept
573
573
return *this ;
574
574
}
575
575
576
+ bool MuHash3072::IsEmptySet () noexcept
577
+ {
578
+ unsigned char num_bytes[Num3072::BYTE_SIZE];
579
+ unsigned char den_bytes[Num3072::BYTE_SIZE];
580
+ m_numerator.ToBytes (num_bytes);
581
+ m_denominator.ToBytes (den_bytes);
582
+ return std::equal (std::begin (num_bytes), std::end (num_bytes), std::begin (den_bytes));
583
+ }
584
+
576
585
MuHash3072& MuHash3072::Insert (Span<const unsigned char > in) noexcept {
577
586
m_numerator.Multiply (ToNum3072 (in));
578
587
return *this ;
Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ class MuHash3072
123
123
/* Divide (resulting in a hash for the difference of the sets) */
124
124
MuHash3072& operator /=(const MuHash3072& div) noexcept ;
125
125
126
+ /* Check if the set is empty. */
127
+ bool IsEmptySet () noexcept ;
128
+
126
129
/* Finalize into a 32-byte hash. Does not change this object's value. */
127
130
void Finalize (uint256& out) noexcept ;
128
131
You can’t perform that action at this time.
0 commit comments