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

Polynomial evaluation related functions added #89

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ph4r05
Copy link
Contributor

@ph4r05 ph4r05 commented Jan 14, 2020

We implemented few other functions related to the GF(2) polynomial evaluation:

  • count(1) is more effective - HW on 64 bits.
  • fast copy of the vector contents
  • evaluate monic polynomial multiple times on input data
    • e.g., x_i, where there are x_0, ..., x_{block_size} terms. I.e., it is a projection of the input, of i-th bit each block_size bits. This can later serve as basis to construct more complex polynomials evaluated on the whole input data repeatedly.
    • e.g. assume base[i] = base[i].eval_monic(input, i, block_size) for i in range(block_size)]
    • then x_2 * x_8 + x_14 = base[2] * base[8] + base[14]
  • fast operations: (A op B).count(1), where op is AND, OR, XOR
    • fast polynomial evaluation when only the number of 1 is required
    • HW(x_2 * x_8 + x_14) = (base[2] * base[8]).fast_hw_xor(base[14]) - the last XOR is performed in-memory, which is faster
  • eval all top-k terms, according to the z-score. Top-k is performed via heap.

We also used vector operations from #20.

Check if there is something usable, I can make a PR using just some parts of this code.

@ph4r05 ph4r05 changed the title [WIP] Polynomial evaluation related functions added Polynomial evaluation related functions added Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant