Skip to content

[EzPC] Substraction with secret signed datatypes returns wrong result #233

@sebw42

Description

@sebw42

Hello, I've noticed some weird behaviour when using the secret signed datatypes.
Here is an example:

def void main(){
	int32_al x = 0;
	int32_al y = 42;
	int32_al z = x - y;
	output(CLIENT, z);
}

This prints Value of z: 4294967254.
If we use the public signed type int32_pl, we get the expected result -42.
The error also occurs when using boolean shares (int32_bl).

These are my compilation and execution steps:

./ezpc.sh test_programs/program.ezpc --bitlen 32
./compile_aby.sh test_programs/program0.cpp
./program0 -r 0 & ./program0 -r 1

Is this behaviour expected?
Thank you for looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions