Skip to content

Commit

Permalink
Fix crc.
Browse files Browse the repository at this point in the history
  • Loading branch information
gogo2464 committed May 31, 2022
1 parent dbf066b commit be6ad4a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -66,7 +66,7 @@ The table below shows which release corresponds to each branch, and what date th

## 4.10.0 (`dev`)


- [#2067][2067] Fix cicd error on CRC

## 4.9.0 (`beta`)

Expand Down
39 changes: 21 additions & 18 deletions pwnlib/util/crc/__init__.py
@@ -1,21 +1,3 @@
"""Module for calculating CRC-sums.
Contains all crc implementations know on the interwebz. For most implementations
it contains only the core crc algorithm and not e.g. padding schemes.
It is horribly slow, as implements a naive algorithm working direclty on
bit polynomials. This class is exposed as `BitPolynom`.
The current algorithm is super-linear and takes about 4 seconds to calculate
the crc32-sum of ``'A'*40000``.
An obvious optimization would be to actually generate some lookup-tables.
This doctest is to ensure that the known data are accurate:
>>> known = sys.modules['pwnlib.util.crc.known']
>>> known.all_crcs == known.generate()
True
"""
from __future__ import absolute_import
from __future__ import division

Expand All @@ -28,6 +10,27 @@
from pwnlib.util import safeeval
from pwnlib.util.crc import known

class Nothing:
"""Module for calculating CRC-sums.
Contains all crc implementations know on the interwebz. For most implementations
it contains only the core crc algorithm and not e.g. padding schemes.
It is horribly slow, as implements a naive algorithm working direclty on
bit polynomials. This class is exposed as `BitPolynom`.
The current algorithm is super-linear and takes about 4 seconds to calculate
the crc32-sum of ``'A'*40000``.
An obvious optimization would be to actually generate some lookup-tables.
This doctest is to ensure that the known data are accurate:
>>> known = sys.modules['pwnlib.util.crc.known']
>>> known.all_crcs == known.generate()
True
"""
pass


class BitPolynom(object):
"""Class for representing GF(2)[X], i.e. the field of polynomials over
Expand Down

0 comments on commit be6ad4a

Please sign in to comment.