Skip to content

Commit 1d98ce9

Browse files
authored
chore: remove stdlib::address and an unused (and unsafe) pedersen method (#16974)
Remove unused primitive `stdlib::address` and method `pedersen_hash<C>::hash_skip_field_validation()` which was unused and was forcing `cycle_scalar` to expose unsafe logic
1 parent 29e6e8e commit 1d98ce9

File tree

3 files changed

+0
-170
lines changed

3 files changed

+0
-170
lines changed

barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,6 @@ field_t<C> pedersen_hash<C>::hash(const std::vector<field_ct>& inputs, const Gen
3333
return result.x;
3434
}
3535

36-
template <typename C>
37-
field_t<C> pedersen_hash<C>::hash_skip_field_validation(const std::vector<field_ct>& inputs,
38-
const GeneratorContext context)
39-
{
40-
using cycle_scalar = typename cycle_group::cycle_scalar;
41-
using Curve = EmbeddedCurve;
42-
43-
const auto base_points = context.generators->get(inputs.size(), context.offset, context.domain_separator);
44-
45-
std::vector<cycle_scalar> scalars;
46-
std::vector<cycle_group> points;
47-
scalars.emplace_back(cycle_scalar::create_from_bn254_scalar(field_ct(inputs.size())));
48-
points.emplace_back(crypto::pedersen_hash_base<Curve>::length_generator);
49-
for (size_t i = 0; i < inputs.size(); ++i) {
50-
// `true` param = skip primality test when performing a scalar mul
51-
scalars.emplace_back(cycle_scalar::create_from_bn254_scalar(inputs[i], true));
52-
// constructs constant cycle_group objects (non-witness)
53-
points.emplace_back(base_points[i]);
54-
}
55-
56-
auto result = cycle_group::batch_mul(points, scalars);
57-
return result.x;
58-
}
59-
6036
/**
6137
* @brief Hash a byte_array.
6238
*

barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ template <typename Builder> class pedersen_hash {
3131

3232
public:
3333
static field_ct hash(const std::vector<field_ct>& in, GeneratorContext context = {});
34-
// TODO health warnings!
35-
static field_ct hash_skip_field_validation(const std::vector<field_ct>& in, GeneratorContext context = {});
3634
static field_ct hash_buffer(const stdlib::byte_array<Builder>& input, GeneratorContext context = {});
3735
};
3836

barretenberg/cpp/src/barretenberg/stdlib/primitives/address/address.hpp

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)