Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Initial PR - #74

Closed
hskang9 wants to merge 9 commits into
LayerXcom:masterfrom
hskang9:accumulator/prime_tester
Closed

Initial PR#74
hskang9 wants to merge 9 commits into
LayerXcom:masterfrom
hskang9:accumulator/prime_tester

Conversation

@hskang9

@hskang9 hskang9 commented Jan 21, 2019

Copy link
Copy Markdown

What I did

resolve #73

I will extend this to have:

  • solve easy answers(e.g. 2,3,5,7)
  • Resolve Fermat liars if they exist

Cute Animal Picture

pic

@hskang9 hskang9 changed the title WIP: Add prime tester to accumulator Add prime tester to accumulator Jan 21, 2019
@private
@constant
def _compare(_a: uint256[8], _b: uint256[8]) -> int128:
for i in range(M_LIST_LENGTH):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I got this error here ;)

line 8: Range only accepts literal (constant) values
    for i in range(M_LIST_LENGTH):
-------------------^

@nrryuya

nrryuya commented Jan 22, 2019

Copy link
Copy Markdown
Member

@hskang9
Thank you! A few comments.

  • Could you rebase to the latest master branch and create a new PR? This inlined version is WIP and I think it'd be better to have a new directory and file contracts/prime/isPrime.vy because this contract can be used as stand-alone.
  • Tests are always necessary ;) Please add tests at tests/prime/test_isPrime.py.

@nrryuya

nrryuya commented Jan 22, 2019

Copy link
Copy Markdown
Member

@hskang9
About tests, I'll prepare BigInt.vy which can be used by isPrime.vy in #79

@hskang9

hskang9 commented Jan 22, 2019

Copy link
Copy Markdown
Author

Thank you! @nrryuya now that I have Big integer operations in separate file, I can focus on the tester. I will create WIP to master branch based on the comments received 👍

@hskang9

hskang9 commented Jan 22, 2019

Copy link
Copy Markdown
Author

Closing this for new PR

@hskang9 hskang9 closed this Jan 22, 2019
@nrryuya

nrryuya commented Jan 22, 2019

Copy link
Copy Markdown
Member

@hskang9
#79 is still WIP so it's OK to wait for my work or to prepare only test cases (without actually executing them) ;)

@hskang9

hskang9 commented Jan 22, 2019

Copy link
Copy Markdown
Author

I will put TODO in comment to remove big integer operations after BigInt.vy is developed.

@hskang9 hskang9 changed the title Add prime tester to accumulator Initial commit Jan 23, 2019
@hskang9 hskang9 changed the title Initial commit Initial PR Jan 23, 2019
@hskang9

hskang9 commented Jan 26, 2019

Copy link
Copy Markdown
Author

This PR is now moved to #81

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RSA Accumulator] Use Fermat Primality Test for verifying prime number

2 participants