Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: firmware/lib/cgptlib/crc32.c

Issue 2815011: Remove unused files, and tidy the directory structure of the remaining ones. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « firmware/lib/cgptlib/cgptlib_internal.c ('k') | firmware/lib/cgptlib/include/cgptlib.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* CRC32 implementation by Gary S. Brown. See license claim below. */ 1 /* CRC32 implementation by Gary S. Brown. See license claim below. */
2 2
3 /* ============================================================= */ 3 /* ============================================================= */
4 /* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or */ 4 /* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or */
5 /* code or tables extracted from it, as desired without restriction. */ 5 /* code or tables extracted from it, as desired without restriction. */
6 /* */ 6 /* */
7 /* First, the polynomial itself and its table of feedback terms. The */ 7 /* First, the polynomial itself and its table of feedback terms. The */
8 /* polynomial is */ 8 /* polynomial is */
9 /* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */ 9 /* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */
10 /* */ 10 /* */
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 /* Returns a 32-bit CRC of the contents of the buffer. */ 99 /* Returns a 32-bit CRC of the contents of the buffer. */
100 uint32_t Crc32(const void *buffer, uint32_t len) { 100 uint32_t Crc32(const void *buffer, uint32_t len) {
101 uint8_t *byte = (uint8_t*)buffer; 101 uint8_t *byte = (uint8_t*)buffer;
102 uint32_t i; 102 uint32_t i;
103 uint32_t value = ~0U; 103 uint32_t value = ~0U;
104 104
105 for (i = 0; i < len; ++i) 105 for (i = 0; i < len; ++i)
106 value = crc32_tab[(value ^ byte[i]) & 0xff] ^ (value >> 8); 106 value = crc32_tab[(value ^ byte[i]) & 0xff] ^ (value >> 8);
107 return value ^ ~0U; 107 return value ^ ~0U;
108 } 108 }
OLDNEW
« no previous file with comments | « firmware/lib/cgptlib/cgptlib_internal.c ('k') | firmware/lib/cgptlib/include/cgptlib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698