Skip to content

Commit

Permalink
fix: more extern
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad committed Jan 11, 2024
1 parent 9771596 commit 3f023dc
Show file tree
Hide file tree
Showing 25 changed files with 7 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ template <typename CircuitBuilder> class pedersen_commitment {
static cycle_group commit(const std::vector<std::pair<field_t, GeneratorContext>>& input_pairs);
};

EXTERN_STDLIB_TYPE(pedersen_commitment);

} // namespace proof_system::plonk::stdlib
} // namespace proof_system::plonk::stdlib
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,4 @@ template <typename C>
bool_t<C> signature_verification_result(const byte_array<C>& message,
const cycle_group<C>& pub_key,
const signature_bits<C>& sig);

#define VERIFY_SIGNATURE_INTERNAL(circuit_type) \
std::array<field_t<circuit_type>, 2> verify_signature_internal<circuit_type>( \
const byte_array<circuit_type>&, const cycle_group<circuit_type>&, const signature_bits<circuit_type>&)

#define VERIFY_SIGNATURE(circuit_type) \
void verify_signature<circuit_type>( \
const byte_array<circuit_type>&, const cycle_group<circuit_type>&, const signature_bits<circuit_type>&)

#define SIGNATURE_VERIFICATION_RESULT(circuit_type) \
bool_t<circuit_type> signature_verification_result<circuit_type>( \
const byte_array<circuit_type>&, const cycle_group<circuit_type>&, const signature_bits<circuit_type>&)

#define CONVERT_SIGNATURE(circuit_type) \
signature_bits<circuit_type> convert_signature<circuit_type>(circuit_type*, const crypto::schnorr::signature&)

EXTERN_STDLIB_METHOD(VERIFY_SIGNATURE_INTERNAL)
EXTERN_STDLIB_METHOD(VERIFY_SIGNATURE)
EXTERN_STDLIB_METHOD(SIGNATURE_VERIFICATION_RESULT)
EXTERN_STDLIB_METHOD(CONVERT_SIGNATURE)

} // namespace proof_system::plonk::stdlib::schnorr
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,5 @@ namespace stdlib {

template <typename Builder> byte_array<Builder> blake2s(const byte_array<Builder>& input);

#define BLAKE2S(circuit_type) byte_array<circuit_type> blake2s(const byte_array<circuit_type>& input)

EXTERN_STDLIB_METHOD(BLAKE2S)

} // namespace stdlib
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ namespace blake2s_plookup {

template <typename Builder> byte_array<Builder> blake2s(const byte_array<Builder>& input);

#define BLAKE2S_ULTRA(ULTRA_TYPE) byte_array<ULTRA_TYPE> blake2s(const byte_array<ULTRA_TYPE>& input)

EXTERN_STDLIB_ULTRA_METHOD(BLAKE2S_ULTRA)
} // namespace blake2s_plookup

} // namespace stdlib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ namespace proof_system::plonk {
namespace stdlib {

template <typename Builder> byte_array<Builder> blake3s(const byte_array<Builder>& input);
#define BLAKE3S(circuit_type) byte_array<circuit_type> blake3s(const byte_array<circuit_type>& input);

EXTERN_STDLIB_METHOD(BLAKE3S)

} // namespace stdlib
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ namespace blake3s_plookup {

template <typename Builder> byte_array<Builder> blake3s(const byte_array<Builder>& input);

#define BLAKE3S_PLOOKUP(circuit_type) byte_array<circuit_type> blake3s(const byte_array<circuit_type>& input)

EXTERN_STDLIB_ULTRA_METHOD(BLAKE3S_PLOOKUP);

} // namespace blake3s_plookup

} // namespace stdlib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,5 @@ template <typename Builder> class keccak {
Builder* context);
};

EXTERN_STDLIB_ULTRA_TYPE(keccak)

} // namespace stdlib
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,4 @@ template <typename Builder> class pedersen_hash {
static field_t hash_buffer(const stdlib::byte_array<Builder>& input, GeneratorContext context = {});
};

EXTERN_STDLIB_TYPE(pedersen_hash);

} // namespace proof_system::plonk::stdlib
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,5 @@ template <typename Builder> field_t<Builder> sha256_to_field(const packed_byte_a
return slices[1] + (slices[0] * (uint256_t(1) << 128));
}

#define SHA256_BLOCK(circuit_type) byte_array<circuit_type> sha256_block(const byte_array<circuit_type>& input)
#define SHA256(circuit_type) packed_byte_array<circuit_type> sha256(const packed_byte_array<circuit_type>& input)

EXTERN_STDLIB_METHOD(SHA256_BLOCK)
EXTERN_STDLIB_METHOD(SHA256)

} // namespace stdlib
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,5 @@ template <typename Builder> class bit_array {
std::vector<bool_t<Builder>> values;
};

EXTERN_STDLIB_TYPE(bit_array);

} // namespace stdlib
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,4 @@ template <typename T> inline std::ostream& operator<<(std::ostream& os, bool_t<T
return os << v.get_value();
}

EXTERN_STDLIB_TYPE(bool_t);

} // namespace proof_system::plonk::stdlib
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,5 @@ template <typename Builder> inline std::ostream& operator<<(std::ostream& os, by
return os;
}

EXTERN_STDLIB_TYPE(byte_array);

} // namespace stdlib
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,3 @@ using UltraCircuitBuilder =
template <class FF> class GoblinUltraCircuitBuilder_;
using GoblinUltraCircuitBuilder = GoblinUltraCircuitBuilder_<barretenberg::field<barretenberg::Bn254FrParams>>;
} // namespace proof_system

#define EXTERN_STDLIB_TYPE(stdlib_type)

#define EXTERN_STDLIB_METHOD(stdlib_method)

#define EXTERN_STDLIB_TYPE_VA(stdlib_type, ...)

#define EXTERN_STDLIB_BASIC_TYPE_VA(stdlib_type, ...)

#define EXTERN_STDLIB_ULTRA_TYPE(stdlib_type)

#define EXTERN_STDLIB_ULTRA_TYPE_VA(stdlib_type, ...)

#define EXTERN_STDLIB_ULTRA_METHOD(stdlib_method)\
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,4 @@ template <typename Builder> inline std::ostream& operator<<(std::ostream& os, fi
return os << v.get_value();
}

EXTERN_STDLIB_TYPE(field_t);

} // namespace proof_system::plonk::stdlib
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,4 @@ inline std::ostream& operator<<(std::ostream& os, cycle_group<ComposerContext> c
return os << v.get_value();
}

EXTERN_STDLIB_TYPE(cycle_group);

} // namespace proof_system::plonk::stdlib
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ template <typename Builder> class logic {
});
};

EXTERN_STDLIB_TYPE(logic);

} // namespace proof_system::plonk::stdlib
} // namespace proof_system::plonk::stdlib
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,5 @@ template <typename Builder> class DynamicArray {
mutable ram_table<Builder> _inner_table;
};

EXTERN_STDLIB_ULTRA_TYPE(DynamicArray);

} // namespace stdlib
} // namespace proof_system::plonk
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,5 @@ template <typename Builder> class ram_table {
mutable Builder* _context = nullptr;
};

EXTERN_STDLIB_ULTRA_TYPE(ram_table);

} // namespace stdlib
} // namespace proof_system::plonk
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,5 @@ template <typename Builder> class rom_table {
mutable Builder* context = nullptr;
};

EXTERN_STDLIB_ULTRA_TYPE(rom_table);

} // namespace stdlib
} // namespace proof_system::plonk
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,5 @@ template <typename Builder> class twin_rom_table {
mutable Builder* context = nullptr;
};

EXTERN_STDLIB_ULTRA_TYPE(twin_rom_table);

} // namespace stdlib
} // namespace proof_system::plonk
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,5 @@ template <typename Builder> inline std::ostream& operator<<(std::ostream& os, pa
return os;
}

EXTERN_STDLIB_TYPE(packed_byte_array);

} // namespace stdlib
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ template <typename Builder> class plookup_read {
const bool is_2_to_1_lookup = false);
};

EXTERN_STDLIB_ULTRA_TYPE(plookup_read);

} // namespace stdlib
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,5 @@ template <typename Builder> inline std::ostream& operator<<(std::ostream& os, sa
return os << v.value;
}

EXTERN_STDLIB_TYPE(safe_uint_t);

} // namespace stdlib
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,5 @@ template <typename T, typename w> inline std::ostream& operator<<(std::ostream&
return os << v.get_value();
}

EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint8_t);
EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint16_t);
EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint32_t);
EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint64_t);

} // namespace stdlib
} // namespace proof_system::plonk
} // namespace proof_system::plonk
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,5 @@ template <typename Builder>
using uint64 =
typename std::conditional<HasPlookup<Builder>, uint_plookup<Builder, uint64_t>, uint<Builder, uint64_t>>::type;

EXTERN_STDLIB_BASIC_TYPE_VA(uint, uint8_t);
EXTERN_STDLIB_BASIC_TYPE_VA(uint, uint16_t);
EXTERN_STDLIB_BASIC_TYPE_VA(uint, uint32_t);
EXTERN_STDLIB_BASIC_TYPE_VA(uint, uint64_t);

} // namespace stdlib
} // namespace proof_system::plonk

0 comments on commit 3f023dc

Please sign in to comment.