Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,5 @@ typename Curve::AffineElement pedersen_commitment_base<Curve>::commit_native(con
}
return result.normalize();
}

template <typename Curve>
typename Curve::AffineElement pedersen_commitment_base<Curve>::commit_native(
const std::vector<std::pair<Fq, GeneratorContext>>& input_pairs)
{
// (TODO @dbanks12 this method may be slow and can be optimised. Issue at .)
Element result = Group::point_at_infinity;
for (auto& [scalar, context] : input_pairs) {
Element point = context.generators->get(1, context.offset, context.domain_separator)[0];
result += point * static_cast<uint256_t>(scalar);
}
return result.normalize();
}
template class pedersen_commitment_base<curve::Grumpkin>;
} // namespace crypto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ template <typename Curve> class pedersen_commitment_base {
using GeneratorContext = typename crypto::GeneratorContext<Curve>;

static AffineElement commit_native(const std::vector<Fq>& inputs, GeneratorContext context = {});
static AffineElement commit_native(const std::vector<std::pair<Fq, GeneratorContext>>& input_pairs);
};

extern template class pedersen_commitment_base<curve::Grumpkin>;
Expand Down