Skip to content
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

MdePkg/BaseLib: Add CRC16 CCITT False Implementation. #6011

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

apop5
Copy link
Contributor

@apop5 apop5 commented Jul 31, 2024

Description

This change is added to incorporate basic implementation for CRC16-CCITT-FALSE algorithm.

This function is useful for providing CRC16 value used in other data structures that requires CRC16 values.
JEDEC specifications for BDAT, eMMC and SPD callout this algorithm.

The lookup table is inherited from https://crccalc.com/ and the result values are also compared against this site.

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

Using BaseLib function, results were verified against the values generated on crccalc.com

Integration Instructions

N/A

@lgao4
Copy link
Contributor

lgao4 commented Aug 1, 2024

Could you list more detail on the consumer code, such as BDAT table?

@apop5
Copy link
Contributor Author

apop5 commented Aug 1, 2024

Could you list more detail on the consumer code, such as BDAT table?

@lgao4

Some embedded controllers require the CRC16 CCITT false algorithm for their communication packets.

JEDEC also seems to favor this, as it is called out in EMMc specification, and SPD specificaitons.

@lgao4 lgao4 added the push Auto push patch series in PR if all checks pass label Aug 6, 2024
This change is added to incorporate basic implementation for
CRC16-CCITT-FALSE algorithm.

This function is useful for providing CRC16 value used in other data
structures that requires CRC16 value that complies with JEDEC SPD
requirements, i.e. BDAT table.

The lookup table is inherited from `https://crccalc.com/` and the result
values are also compared against this site.

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
@mergify mergify bot merged commit a29a9cc into tianocore:master Aug 6, 2024
126 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants