fix(fq12): branch DecompressKarabina on g3 rather than g5 - #874
Open
4waan wants to merge 1 commit into
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What's wrong
DecompressKarabinaandBatchDecompressKarabinaguard onx.C1.B2, commented/* g3 == 0 */. Theelsearm of that sameifdivides by4 * x.C1.B0,commented
// t1 = 4 * g3. Two different coordinates are calledg3in one function.The guard tests
g5. It should testg3.Consequences
Both silent:
g3 == 0,g5 != 0else, divides by4 * g3 == 0Divmaps 0 to 0, sog4 = 0g5 == 0,g3 != 0if, computes2 * g1 * g5 / g2 = 0g4 = 0The
ifarm has never run for the case it was written for.Only
fq12over6over2disagreed.Verification
CyclotomicSquareCompressedmatched a genuine squaring 19227/19227.Severity
Not
2^-508. These inputs are constructible in polynomial time.G_Φ2is rationally parameterised by Hilbert 90,G_Φ6is its image underx -> x^(p²+1), andx -> x^(p²)is diagonal on the six coordinates. Soy(z) = W/conj(W)withW = z * Frob2(z)is a low-degree rational map ontoG_Φ6.Restrict
zto a line andg3(y) = 0becomes a degree-12 univariate overFp2.Root-finding it gives genuine cyclotomic elements with
g3 = 0, g2 != 0, y != 1onbls12-381 (first random line) and bn254 (second), in seconds.