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

Update hash-data-using-fnv.yml #792

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions data-manipulation/hashing/fnv/hash-data-using-fnv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,22 @@ rule:
- https://create.stephan-brumme.com/fnv-hash/
examples:
- ad4229879180e267f431ac6666b6a0a2:0x14007B4D4
- 09BF850BE5DA44A1C3629A1F62813A83:0x10006010
features:
- and:
- optional:
- characteristic: loop
- number: 0xcbf29ce484222325 = FNV_offset_basis, unused by FNV-0
- number: 0x811c9dc5 = FNV_offset_basis, unused by FNV-0
- and:
- number: 0xcbf29ce4 = FNV_offset_basis 64 bits, 32-bit value
- number: 0x84222325 = FNV_offset_basis 64 bits, 32-bit value
- or:
- number: 0x100000001b3 = FNV prime
- number: 0x01000193 = FNV prime
- and:
- number: 0x100 = FNV prime 64 bits, split in DWORD
- number: 0x1b3 = FNV prime 64 bits, split in DWORD
- basic block:
# FNV-1 hash does multiply then XOR
# FNV-1a hash does XOR then multiply
Expand All @@ -33,3 +40,4 @@ rule:
- or:
- mnemonic: imul
- mnemonic: mul
- api: _allmul
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a function-name feature?

linter fails: FAIL: doesn't match on referenced example: Fix the rule logic or provide a different example

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williballenthin _allmul is an api feature here and function-name is not valid in a basic block
are these two issues?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function-name is for matching the name of the current function. i think api is correct here.

Loading