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

Add tests and refactor polynomial.py #51

Merged
merged 1 commit into from
Sep 20, 2018
Merged

Conversation

smkuls
Copy link
Contributor

@smkuls smkuls commented Sep 7, 2018

  • Refactoring and cleaning up polynomial.py
  • Adding tests to verify the functionality of the methods

@codecov-io
Copy link

codecov-io commented Sep 7, 2018

Codecov Report

Merging #51 into dev will increase coverage by 2.30657%.
The diff coverage is 100%.

@@                 Coverage Diff                 @@
##                 dev         #51         +/-   ##
===================================================
+ Coverage   74.08231%   76.38889%   +2.30657%     
===================================================
  Files             11          11                 
  Lines            899         864         -35     
  Branches         150         142          -8     
===================================================
- Hits             666         660          -6     
+ Misses           206         183         -23     
+ Partials          27          21          -6

from random import randint

Field = GF(0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001)
Poly = polynomial.polynomialsOver(Field)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

p.s.: If using the fixtures, you'll need to invoke them for each test function: e.g.:

def test_poly_eval_at_k(GaloisField, Polynomial):
    poly1 = Polynomial([0, 1])  # y = x
    # ...
    coeffs = [randint(0, GaloisField.modulus-1) for i in range(d)]
    # ...

honeybadgermpc/polynomial.py Show resolved Hide resolved
honeybadgermpc/polynomial.py Show resolved Hide resolved
honeybadgermpc/polynomial.py Show resolved Hide resolved
honeybadgermpc/polynomial.py Show resolved Hide resolved
@smkuls smkuls merged commit 4cacb9a into initc3:dev Sep 20, 2018
@smkuls smkuls deleted the polynomial-tests branch January 17, 2019 23:08
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.

4 participants