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

Registration function #84

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

Registration function #84

wants to merge 3 commits into from

Conversation

vqhuy
Copy link
Collaborator

@vqhuy vqhuy commented Aug 8, 2016

This pull does:

  • Sends registration request to CONIKS bots
  • Intercepts CONIKS's response DM
  • Verifys TB
  • Stores STR & TB to disk

TODO:
Handle registration when account is disconnected right after sending registration message or when users delete & restore their account. These cases need to be thoroughly analyzed (I would like to resolve it in a separate pull).

Changes compare to our discussion in #82 (comment):

  • The STR is stored in JSON, not binary (in a separate file named coniks.str), for example: {"epoch":0,"signature":[44,211,71,118,247,94,211,15,53,72,108,143,26,68,61,250,51,167,120,188,255,34,106,123,12,132,125,86,247,213,139,254,238,23,57,250,51,49,3,233,67,59,137,224,176,24,203,110,85,65,30,159,222,196,126,98,138,247,18,153,187,133,54,13]}. The reason is I think the storage space should not be a concern, and I would like to use only one format for all files (i.e., JSON).
  • The same for TB storage. The TB's index is stored as a part of AccountContext, and after verifying the TB is inserted as promised, it will be set to null.

let msgPtr = ctypes.unsigned_char.array()(m);
let indexPtr = ctypes.unsigned_char.array()(index);
let proofPtr = ctypes.unsigned_char.array()(proof);
if (libCONIKS.cgoVerifyVrf(pkPtr, pk.length,
Copy link

Choose a reason for hiding this comment

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

Do we want to compare this to the test-vectors here: https://github.com/yahoo/end-to-end/blob/master/src/javascript/crypto/e2e/coname/vrf/vrf_test.html ? Maybe (later), we should also consider this comment YahooArchive/end-to-end#58 (comment) / issue YahooArchive/end-to-end#59 (on the golang-side, too)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, could you please elaborate on this? Why do we want to perform that comparison?

Copy link

@liamsi liamsi Aug 12, 2016

Choose a reason for hiding this comment

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

I thought it might provide an extra check that on the JS side everything works as expected. It might be an overkill as the cgo part is already (well) tested. The second sentence refers to the FromBytesBaseGroup in the coname's vrf code (which lacks some checks as explained in YahooArchive/end-to-end#59 and which is not directly related to this PR).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought it might provide an extra check that on the JS side everything works as expected. It might be an overkill as the cgo part is already (well) tested.

I think it's not really necessary since the vrf is implemented in go and is already tested.

The second sentence refers to the FromBytesBaseGroup in the coname's vrf code (which lacks some checks as explained in YahooArchive/end-to-end#59 and which is not directly related to this PR).

Yes. Should we open new ticket for this?

@vqhuy vqhuy changed the title Registration function [WIP] Registration function Aug 18, 2016
@arlolra arlolra added the coniks label Aug 23, 2016
@vqhuy vqhuy changed the title [WIP] Registration function Registration function Aug 23, 2016
* Send registration request to CONIKS bots

* Intercept CONIKS's response DM

* Verify response

* Store STR & TB to disk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants