Update EC parameter for 512 bit sized flags #163
+4
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's possible to reconstruct the parameters of the EC to:
But the p_new breaks the special type (anomalous) of the curve.
Analyzing the original curve shows a generation process by the CM method with discriminant D=163 and an additional scaling of a and b by 84557434003015851013164945005322176013 to hide the process/structure of generation.
The original prime from the challenge was choosen randomly.
121...807
791...437
With this, some checks for e.g. a twisted curve and a choosen p with 256 bit, it's possible to build a similar curve having the same properties as the original one but is capable of carrying the two 256 bit sized parts of the pwn.college flag.
[*] Searching for 256-bit prime p for Anomalous Curve (D = 163)...
[+] Found Prime p: 591...757
[+] Curve is Anomalous! (|E| == p)
[+] The curve is non-singular
[+] 4p - 1 = 163 * v^2 is square
v = 380...873
[+] j-invariant matches D = 163
a = 178...461
b = 429...900
p = 591...757
This closes #145.