-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add SHA256 Tutorial #387
Add SHA256 Tutorial #387
Conversation
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @m-meidani on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @m-meidani on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Rasoul Akhavan Mahdavi.
|
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @m-meidani, @RasoulAM on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
1 similar comment
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @m-meidani, @RasoulAM on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use chunks
terminology instead of slices
?
Done. 88a0847 |
Can you replace explicit tables: extract_one_bit_carry = fhe.LookupTable([x // (2 ** WIDTH) for x in range(2**(WIDTH+1))])
extract_chunk_from_two_operand_sum = fhe.LookupTable([x % (2 ** WIDTH) for x in range(2**(WIDTH+1))])
extract_two_bit_carry = fhe.LookupTable([x // (2 ** WIDTH) for x in range(2**(WIDTH+2))])
extract_chunk_from_four_operand_sum = fhe.LookupTable([x % (2 ** WIDTH) for x in range(2**(WIDTH+2))]) with regular operations carries = extract_two_bit_carry[added]
# to
carries = added // (2**WIDTH)
# or even better
carries = added >> WIDTH # extract the carry bit |
Are those operations implemented? When we were implementing they were not. |
Constant ones are implemented a long time ago, only all operands encrypted version was not :) |
Done. b8d19a0 |
Still two remaining: extract_one_bit_carry = fhe.LookupTable([x // (2 ** WIDTH) for x in range(2**(WIDTH+1))])
extract_chunk_from_two_operand_sum = fhe.LookupTable([x % (2 ** WIDTH) for x in range(2**(WIDTH+1))]) |
Thanks for pointing those out. Does that mean these can be replaced as well?
|
Yes, they can be replaced, I'd replace the first one with fhe.univariate and second one with a direct division. |
Lastly, could you:
Then it's good to go for me :) |
We decided not to give number_of_rounds as an argument to the function because it complicates many other parts of the code. For example, the inputset must be adjusted to include the number of rounds as well, mainly when you are less than 64 rounds. |
This is not the case with the changes I've suggested. You can wrap it in a lambda with a single argument :) |
Done. Thanks for the suggestion :D |
Lovely, could you squash your commits into a single one with the message:
|
Done. Does that looks good? |
A tutorial on implementing SHA256 as part of the bounty program has been added, utilizing concrete operations. The accompanying notebook details all necessary steps and implements required operations such as 32-bit additions, rotations, and shifts. Some assumptions are: