data61 / MP-SPDZ

Versatile framework for multi-party computation
Other
928 stars 279 forks source link

[Ring element] Assgin zero without clear the vector #1510

Closed jscode017 closed 1 month ago

jscode017 commented 1 month ago

Hi @mkskeller May I ask how I can assign zero to a ring element without clearing it up? Since in https://github.com/data61/MP-SPDZ/blob/20dfe63959a9f42e59533c6d7fd7cf0b5251f9fe/FHE/Ring_Element.cpp#L59, It clear the vector Is there any way to do it as assign_one: https://github.com/data61/MP-SPDZ/blob/20dfe63959a9f42e59533c6d7fd7cf0b5251f9fe/FHE/Ring_Element.cpp#L65, but fills zeros instead?

Or does running .allocate() will initialize it to all zeros?

Thanks in advance

mkskeller commented 1 month ago

Calling allocate() when empty should do the trick indeed.