Open ghoshbishakh opened 2 years ago
This is my current hack:
GtElement& GtElement::operator =(const GtElement& other)
{
gt_t tmp;
gt_null(tmp);
gt_new(tmp);
memcpy(tmp, other.gtpoint, sizeof(other.gtpoint));
gt_copy(gtpoint, tmp);
gt_free(tmp);
return *this;
}
Thanks for the notification+details!
If you are using the BLS12-381 preset or the default configuration, then gt_copy
is defined to be fp12_copy
. I had tried enforcing const correctness for the extension field types a few years ago, but failed somehow.
Would that simple change fix the situation?
It should definitely fix the problem. Currently, the way around I mentioned above is working fine it seems. There is another issue #234 which caused a major headache.
Thank you so much for your support and this awsm project!
I am trying to use relic in a C++ project (MPSPDZ). In a class with members of type
gt_t
, I am trying to overload some operators. For example, to assigngt_t gtpoint
, we need to usegt_copy
. Howevergt_copy
expects a non constant pointer but for operator overloading we will always get a const.Two questions:
gt_copy
affect relic in any unwanted way?gt_copy
how to determine which function is going to be used, is there any documentation on that?