You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#456 added WriteTo and ReadFrom to the rlwe.Parameters without adding associated tests and it actually fails when calling .ReadFrom.
This can be easily reproduced by testing the serialization of rlwe.Parameters with the method buffer.RequireSerializerCorrect, which returns the error: unexpected end of JSON input.
This happens because .BinarySize() is called on empty parameters by ReadFrom to get the number of bytes to read. But this returns the wrong size because the serialization size of rlwe.Parameters is dependant on the content of the struct.
-> Do like other content-dependent structs (e.g. ring.Poly): add a 4/8 bytes prefix with the number of bytes to read
The text was updated successfully, but these errors were encountered:
Pro7ech
changed the title
Bug [rlwe]: rlwe.Parameters serialization due to PR #456
Bug [rlwe]: rlwe.Parameters.ReadFrom fails due to PR #456
May 2, 2024
Pro7ech
changed the title
Bug [rlwe]: rlwe.Parameters.ReadFrom fails due to PR #456
Bug [rlwe]: rlwe.Parameters.ReadFrom fails (PR #456)
May 2, 2024
#456 added
WriteTo
andReadFrom
to therlwe.Parameters
without adding associated tests and it actually fails when calling.ReadFrom
.This can be easily reproduced by testing the serialization of
rlwe.Parameters
with the methodbuffer.RequireSerializerCorrect
, which returns the error:unexpected end of JSON input
.This happens because
.BinarySize()
is called on empty parameters byReadFrom
to get the number of bytes to read. But this returns the wrong size because the serialization size ofrlwe.Parameters
is dependant on the content of the struct.-> Do like other content-dependent structs (e.g.
ring.Poly
): add a 4/8 bytes prefix with the number of bytes to readThe text was updated successfully, but these errors were encountered: