Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does ABY support real numbers? #22

Closed
xiaolixiaoyi opened this issue Apr 1, 2017 · 9 comments
Closed

Does ABY support real numbers? #22

xiaolixiaoyi opened this issue Apr 1, 2017 · 9 comments

Comments

@xiaolixiaoyi
Copy link

I want to test the performance of addition and multiplication of real numbers in ABY.
Is there built-in types for fixed-point or floating-point numbers in ABY?
Does ABY support right shift or left shift operations for sharings?

@dd23
Copy link
Member

dd23 commented Apr 18, 2017

ABY does support the following operations on floating-point numbers of different precisions using BooleanCircuit::PutFPGate():
ADD, MUL, SUB, DIV, SIN, SQRT, EXP, EXP2, CMP, LN, LOG2, COS, SQR (as defined here)

There are some shift operations available for Boolean Circuits:

Hope that helps. Let me know if you have further questions.

@haik
Copy link

haik commented May 18, 2017

@dd23 I guess the main difference lies in the declaration of operands and I tried to modify them. But I always encountered such problems as no member named PutFPGate, expects argument of type, but argument has type. I was wondering if you could give me some example?

@williamclot
Copy link

Would be great to have a example with a SQRT!

@dd23
Copy link
Member

dd23 commented Dec 13, 2018

There is an example for using floating-point gates: https://github.com/encryptogroup/ABY/blob/public/src/examples/float/abyfloat.cpp

I have just extended it in b21faaf and added an example for SQRT as well. Hope this helps.

@williamclot
Copy link

Cheers! Thank you very much.

@williamclot
Copy link

I've been working with FPGates on the latest b21faaf commit. Would it be possible to have a different path to the circ folder then "../../bin/circ". Maybe putting it as variable somewhere?

@dd23
Copy link
Member

dd23 commented Jul 24, 2019

Took some time, but since ede04f8 it's now possible to specify the path to the circuits at runtime by passing it to the ABYParty constructor, e.g., like in the float example.

The default is still "../../bin/circ" so the old examples and the current directory structure of the repo keeps on working.

@ShivamBansal99
Copy link

ShivamBansal99 commented Sep 28, 2020

Is there an example with an EXP FP gate? Or is there any way to view the intermediate float values in the shares for debugging?

@dd23
Copy link
Member

dd23 commented Feb 25, 2021

There is currently no example for the EXP FP gate, but if you submit a pull request, we can include it in the repo.

@dd23 dd23 closed this as completed Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants