-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RSA Phase Estimate Bloq and Move ModExp to rsa/ subdirectory (#1428)
* Add rsa files - needs a lot of work just stashing it for now * Made some structure changes RSA * Rework rsa mod exp bloqs to work in a rsa phase estimation circuit * Fix mypy issues * Better symbolic messages * Refactor RSA to have a phase estimation circuit and a classical simulable modular exponentiation circuit * Fix notebook specs merge conflict * remove unecessary x values for classical simulation test * fix nits * Better documentation init * Fix broken link * Fix random issue and cirq interop import of modexp * Fix broken import msft interop * Fix another dependency of ModExp --------- Co-authored-by: Matthew Harrigan <[email protected]>
- Loading branch information
1 parent
3117a84
commit c227032
Showing
21 changed files
with
611 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# isort:skip_file | ||
|
||
r"""Bloqs for breaking RSA cryptography systems via integer factorization. | ||
RSA cryptography is a form of public key cryptography based on the difficulty of | ||
factoring the product of two large prime numbers. | ||
Using RSA, the cryptographic scheme chooses two large prime numbers p, q, their product n, | ||
λ(n) = lcm(p - 1, q - 1) where λ is Carmichael's totient function, an integer e such that | ||
1 < e < λ(n), and finally d as d ≡ e^-1 (mod λ(n)). The public key consists of the modulus n and | ||
the public (or encryption) exponent e. The private key consists of the private (or decryption) | ||
exponent d, which must be kept secret. p, q, and λ(n) must also be kept secret because they can be | ||
used to calculate d. | ||
Using Shor's algorithm for factoring, we can find p and q (the factors of n) in polynomial time | ||
with a quantum algorithm. | ||
References: | ||
[RSA (cryptosystem)](https://en.wikipedia.org/wiki/RSA_(cryptosystem)). | ||
""" | ||
|
||
from .rsa_phase_estimate import RSAPhaseEstimate | ||
from .rsa_mod_exp import ModExp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.