question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`SecInt` bit widths seemingly not enforced

See original GitHub issue

Suppose 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:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lschoecommented, Sep 22, 2022

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.

0reactions
samcowgercommented, Sep 22, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found