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
Why: Currently, it's very easy to create UInt64 or UInt32 from a Field without range-checking it, without given any hint that this is unsafe. For Bool we do a much better job: the only way to create it from a Field is with Bool.Unsafe.ofField()
How:
Remove Field as input type from UInt64.from(). Replace with something like UInt64.Unsafe.fromField()
Remove Field as possible constructor input. The tricky thing is that UInt64 really consists of 1 Field, so we need a way to construct it from field at least in internal methods. There are two ways around this:
make the constructor take a FieldVar instead of a Field, so that creating it from a Field becomes a less visible and more low-level operation. This is how Bool does it.
or make the constructor private externally. This makes the breaking change more breaking though.
The text was updated successfully, but these errors were encountered:
Why: Currently, it's very easy to create
UInt64
orUInt32
from aField
without range-checking it, without given any hint that this is unsafe. ForBool
we do a much better job: the only way to create it from aField
is withBool.Unsafe.ofField()
How:
Field
as input type fromUInt64.from()
. Replace with something likeUInt64.Unsafe.fromField()
Field
as possible constructor input. The tricky thing is thatUInt64
really consists of 1 Field, so we need a way to construct it from field at least in internal methods. There are two ways around this:FieldVar
instead of aField
, so that creating it from aField
becomes a less visible and more low-level operation. This is howBool
does it.The text was updated successfully, but these errors were encountered: