fix(math): reduce Bézout coefficient modulo irreducible polynomial in gfExtendedEuclideanWithTrace (#1715) - #1811
Conversation
… gfExtendedEuclideanWithTrace (csxark#1715) - Apply polynomial modulo reduction (gfDivide(s0, modulus).r) after Extended Euclidean algorithm loop in lib/math/galoisField.ts - Format inverseHex as 2 uppercase hex digits, guaranteeing canonical 8-bit element representation in GF(2^8) - Add unit test coverage in tests/math/galoisField.test.ts asserting EEA inverseHex matches gfInverse for all non-zero elements [1..255] across field polynomials (0x11b, 0x11d, 0x12d)
|
@nayanraj864-cmyk is attempting to deploy a commit to the csxark's projects Team on Vercel. A member of the Team first needs to authorize it. |
🎉 Thank You for Your ContributionHello @nayanraj864-cmyk, Thank you for submitting a Pull Request to CryptoViz. We appreciate the time and effort you've invested in contributing to the project. Your Pull Request has been received successfully and will be reviewed by the maintainers as soon as possible. 📋 Pull Request Checklist
Ensuring these requirements are met helps streamline the review process and enables maintainers to review your contribution more efficiently. ❤️ Support CryptoVizIf you find CryptoViz helpful, consider supporting the project by:
Your support helps increase the project's visibility and encourages continued development. Thank you for being a part of the CryptoViz community! Thank you once again for contributing to CryptoViz. We appreciate your support and look forward to reviewing your contribution. |
|
Warning Review limit reachedNext included review available in 23 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎉 Pull Request MergedHello @nayanraj864-cmyk, Thank you for your contribution to CryptoViz. Your Pull Request has been reviewed and successfully merged into the project. We sincerely appreciate the time and effort you invested in improving the project. Contributions like yours help make CryptoViz better for the entire community. We look forward to your future contributions and hope to collaborate with you again. ❤️ Support CryptoVizIf you find CryptoViz helpful, consider supporting the project by:
Your support helps increase the project's visibility and encourages continued development. Thank you for being a part of the CryptoViz community! |
Pull Request
Description
Fixes issue #1715 by applying polynomial modulo reduction ($s_0$ in $\text{GF}(2^8)$ matching
gfDivide(s0, modulus).r) to the Bézout coefficientgfExtendedEuclideanWithTrace. This guarantees thatinverseHexoutputs a canonical 2-digit uppercase 8-bit hex string ingfInverse(a)across all non-zero field elements.Related Issue
Closes #1715
Scope
lib/cipher/**,lib/math/**)app/**,components/**)lib/workers/**,hooks/use*Worker.ts)docs/**,*.md, MDX content)tests/**)Changes Made
const finalS = gfDivide(s0, modulus).ringfExtendedEuclideanWithTraceinsidelib/math/galoisField.tsafter the Euclidean loop completes.finalSas a 2-character uppercase hex string (padStart(2, '0').toUpperCase()).tests/math/galoisField.test.tsverifyinggfExtendedEuclideanWithTracematchesgfInversefor all non-zero elements0x11b,0x11d, and0x12dfield polynomials.Testing
npm testpasses locally.npm run typecheckpasses locally.npm run lintpasses locally.lib/math/**file stays at or above 80%.Simulation vs. Live Data
Screenshots
N/A (Galois Field Polynomial Modulo Reduction & Trace Formatting)
Checklist
Applicable Checklist
Architecture Review Checklist
lib/math/galoisField.tstests/math/galoisField.test.tsAdditional Notes
All Galois Field math unit tests (
npx vitest run tests/math/galoisField.test.ts) passed cleanly.