diff --git a/src/bls/bls.h b/src/bls/bls.h index 17b610ab0910..5b4df18aa22e 100644 --- a/src/bls/bls.h +++ b/src/bls/bls.h @@ -62,6 +62,10 @@ class CBLSWrapper static NullHash nullHash; cachedHash = nullHash.hash; } + CBLSWrapper(const std::vector& vecBytes) : CBLSWrapper() + { + SetBuf(vecBytes); + } CBLSWrapper(const CBLSWrapper& ref) = default; CBLSWrapper& operator=(const CBLSWrapper& ref) = default; @@ -238,6 +242,7 @@ class CBLSId : public CBLSWrapper using CBLSWrapper::operator=; using CBLSWrapper::operator==; using CBLSWrapper::operator!=; + using CBLSWrapper::CBLSWrapper; CBLSId() {} @@ -254,6 +259,7 @@ class CBLSSecretKey : public CBLSWrapper vecBytes{static_cast(i)}; + vecBytes.resize(CBLSSecretKey::SerSize); - smle.pubKeyOperator.Set(sk.GetPublicKey()); + smle.pubKeyOperator.Set(CBLSSecretKey(vecBytes).GetPublicKey()); smle.keyIDVoting.SetHex(strprintf("%040x", i)); smle.isValid = true;