Commit c6e41640 authored by Bernard van Gastel's avatar Bernard van Gastel
Browse files

Removed unused function, and improved bound for FromHex function.

parent b62df54c
......@@ -229,7 +229,7 @@ uint8_t FromDigit(char _c) {
void FromHex(uint8_t* out, size_t out_len, std::string_view in) {
if (out_len*2 != in.length())
throw std::invalid_argument("FromHex expected different size");
for (const char* it = in.begin(); it < in.end(); it += 2) {
for (auto it = in.begin(); it+1 < in.end(); it += 2) {
uint8_t l = FromDigit(*it);
uint8_t r = FromDigit(*(it+1));
*(out++) = uint8_t(l<<4) | r;
......
......@@ -42,10 +42,6 @@ GroupElement pep::Decrypt(const ElGamal& in, const Scalar& y) {
return in.C - y * in.B;
}
ElGamal RerandomizeY(const ElGamal& in, const Scalar& s) {
return {in.B - s*G, in.C, in.Y + s*G};
}
// randomize the encryption
ElGamal pep::Rerandomize(const ElGamal& in, const Scalar& s) {
return {s * G + in.B, s * in.Y + in.C, in.Y};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment