`SecInt` bit widths seemingly not enforced
See original GitHub issueSuppose I run the following program on three parties, with input hardcoded purely to demonstrate this issue:
from mpyc.runtime import mpc
async def main():
await mpc.start()
a0 = mpc.input(mpc.SecInt(8)(300))
a1 = a0[0] + a0[1] + a0[2]
print(await mpc.output(a1))
await mpc.shutdown()
mpc.run(main())
(I’m executing this program on localhost in three separate shells via python prog.py -M 3 -I {0,1,2} -B 8000
, Python 3.10.5.)
At first glance, I would expect this program to either:
- Produce an error at the attempt to initialize
SecInt(8)
with a value that overflows the type’s nominal range, - Produce an error at the attempt to
output
the result of the overflowing addition, or - Silently overflow and produce the result
-124
(i.e.(300 + 300 + 300) & 0xff
interpreted as a two’s-complement signed value)
Instead, the program produces the result 900
. Should I expect this behavior, or is there some way I can leverage the library’s other types to achieve one of the potential behaviors I listed above?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why does base64 encoding require padding if the input length ...
Padding allows us to decode base64 encoding with the promise of no lost bits. Without padding there is no longer the explicit acknowledgement...
Read more >Diving Into Delta Lake: Schema Enforcement & Evolution
Learn how schema enforcement and schema evolution work together on Delta Lake to ensure high quality, reliable data.
Read more >What Every Computer Scientist Should Know About Floating ...
The second part discusses the IEEE floating-point standard, ... Floating-point representations are not necessarily unique. ... Exponent width in bits ...
Read more >Addressable Memory - an overview | ScienceDirect Topics
As described in Section 5.5, memories are organized as an array of data words. The MIPS architecture uses 32-bit memory addresses and 32-bit...
Read more >Glossary of Security Terms - SANS Institute
Usually holds one character of information and usually means eight bits. ... If the filtering implementation does not enforce a minimum fragment size, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
MPyC v0.8.8 with support for secure (secret-shared) NumPy arrays is now available on GitHub, check it out!
Threshold SHA3 is one of the new demos, see sha3.py.
Cool! Thank you for the advice, and for the SHA3 pointer. I think my original question has been sufficiently addressed, so I’ll go ahead and close this issue.