Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 87edbf5

Browse files
committed
Conver to the required integral type when multiplying a scalar with a curve point.
1 parent 45074e0 commit 87edbf5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libs/algebra/include/nil/crypto3/algebra/curves/detail/scalar_mul.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ namespace nil {
174174
GroupValueType>::type
175175
operator*(const GroupValueType &left, const FieldValueType &right) {
176176

177-
return left * static_cast<typename GroupValueType::params_type::scalar_field_type::integral_type>(right.data);
177+
// TODO(martun): consider deleting this function, and forcing all the callers to convert to the
178+
// required type before multiplication.
179+
return left * static_cast<typename GroupValueType::params_type::scalar_field_type::integral_type>(
180+
typename FieldValueType::integral_type(right.data));
178181
}
179182

180183
template<typename GroupValueType, typename FieldValueType>

0 commit comments

Comments
 (0)