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 ed25519 support to the p2p/crypto package #827

Closed
wants to merge 3 commits into from
Closed

Conversation

mildred
Copy link
Contributor

@mildred mildred commented Feb 26, 2015

This is a follow-up of pull request #677. It has been completely re-made from zero. I started with two commits to clean up things a little bit, then implemented the ed25519 algorithm using the agl/ed25519 pure go library and with tests first.

@btc btc added the status/in-progress In progress label Feb 26, 2015

type Ed25519PublicKey struct {
k *[ed25519.PublicKeySize]byte
}
Copy link
Member

Choose a reason for hiding this comment

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

maybe we can put these inside an ed25519 package so importing them is:

ed25519.PublicKey

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking of implementing it the same way for RSA and ed25519. Do you think it is also desirable to put the RSA functions in a separate package as well ?

Also, I'm a bit reluctant here because we would have two packages containing different things and having the same name. the ed25519 from github.com/agl/ed25519 an the version from p2p/crypto/ed25519. Do you think this should be avoided, or not ? Same with the rsa package.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking of implementing it the same way for RSA and ed25519. Do you think it is also desirable to put the RSA functions in a separate package as well ?

Yeah, and they can follow a common interface.

Also, I'm a bit reluctant here because we would have two packages containing different things and having the same name. the ed25519 from github.com/agl/ed25519 an the version from p2p/crypto/ed25519. Do you think this should be avoided, or not ? Same with the rsa package.

Thanks for caring about this detail :) -- I think in this case it will be fine. Kind of like path and crypto and net. the common names are overloaded-- the fully qualified import path is the truth. thankfully, in Go the local variable being bound at the top of the file let's the user quickly tell which it's coming from.

@mildred
Copy link
Contributor Author

mildred commented Feb 26, 2015

The builds are failing because of missing package github.com/agl/ed25519. I was under the impression that go is automatically downloading dependencies, and this isn't the case here. Does anyone knows why?

@mildred mildred mentioned this pull request Feb 26, 2015
@cryptix
Copy link
Contributor

cryptix commented Feb 26, 2015

I was under the impression that go is automatically downloading dependencies, and this isn't the case here.

In general, running 'go get' in a project does fetch all dependencies but we don't want to depend on the most current version (i.e. sudden breakage) that's why we copy the deps into Godeps/_workspace and rewrite the import paths.

We have a target to do this automatically, try 'make vendor' in the project root.

ps: you sadly need to squash the commits that had the unvendored paths in it. Jenkins is setup to test every commit. @jbenet we should have contributor guidelines for this.

@mildred
Copy link
Contributor Author

mildred commented Feb 26, 2015

Thank you.

After running make vendor, I had a few modifications about a package go-humanize that disappeared from Godeps, I didn't commit that, because I didn't know if this was correct.

@cryptix
Copy link
Contributor

cryptix commented Feb 26, 2015

go-humanize disappeared

Oh right. I saw that as well on my spring-cleaning spree yesterday. Didn't finish it though.. I think you were right to leave it out of this, really isn't related.

@cryptix
Copy link
Contributor

cryptix commented Feb 26, 2015

Two Failures on travis, but only one relevant. race: limit on 8192 simultaneously alive goroutines is exceeded, dying from exchange/bitswap creeps up from time to time, right @jbenet?

But the build-walk-branch want's every commit to pass the test, so a commit with unvendorded deps will always fail.. You need to squash the offending commits and force push this branch to trigger jenkins again.

ps: I found this document useful on how to do the squashing, otherwise feel free to reach out on IRC.

@mildred
Copy link
Contributor Author

mildred commented Feb 26, 2015

Ok, I'll rebase my branch soon, thanks

Vendoring github.com/agl/ed25519
@mildred
Copy link
Contributor Author

mildred commented Feb 27, 2015

Travis build using Go 1.3 are failing with:

not ok 24 - 'ipfs daemon' is ready
#
# IPFS_PID=$! &&
# test_wait_output_n_lines_60_sec actual_daemon 2 &&
# test_run_repeat_60_sec "grep \"API server listening on $ADDR_API\" actual_daemon" ||
# test_fsh cat actual_daemon || test_fsh cat daemon_err
# 

for both the continuous-integration/travis-ci/pr and continuous-integration/travis-ci/push builds. Go 1.4 builds are fine. Do you have an idea where it comes from ? This pull request doesn't touch sharness tests.

Jenkins fails with the race: limit on 8192 simultaneously alive goroutines is exceeded, dying error that you told me could be ignored.

@whyrusleeping
Copy link
Member

that failure on 1.3 isnt really just 1.3. ive seen it on 1.4, but for some reason its most common on 1.3. No idea. but its not your fault. And the race error isnt something you need to worry about either.

@jbenet
Copy link
Member

jbenet commented Feb 27, 2015

@mildred other than the packaging move, this LGTM.

@whyrusleeping
Copy link
Member

Looks good to me. All the right tests seem to pass

@whyrusleeping
Copy link
Member

I was diagnosing some performance issues tonight and I found out that rsa's signing algorithms are eating up a TON of our time. ed25519 claims to have fast signing? @jbenet @mildred Lets get this merged in, i want better perf! 😄

@jbenet
Copy link
Member

jbenet commented Mar 16, 2015

Agreed, let's get this merged. if @mildred is not around, maybe we can rebase + move the package ourselves.

@whyrusleeping whyrusleeping added topic/commands Topic commands topic/repo Topic repo labels Mar 28, 2015
@dylanPowers
Copy link
Member

This was labeled as "in progress", but we don't have anyone assigned 😨 Please assign someone 😃

@jbenet jbenet added backlog and removed status/in-progress In progress labels Apr 1, 2015
@jbenet
Copy link
Member

jbenet commented Apr 1, 2015

Let's keep this in the backlog (or icebox). Can maybe land after upcoming keyspec anyway


Sent from Mailbox

On Mon, Mar 30, 2015 at 8:32 PM, Dylan Powers notifications@github.com
wrote:

This was labeled as "in progress", but we don't have anyone assigned 😨 Please assign someone 😃

Reply to this email directly or view it on GitHub:
#827 (comment)

@whyrusleeping
Copy link
Member

closing due to inactivity, please reopen as necessary

note: all pull requests older than three weeks may be closed in an effort to keep our open pull requests more focused.

@dylanPowers
Copy link
Member

@whyrusleeping I like the idea of putting issues/pull-requests in the icebox when there's been a period of inactivity. That way we can have a flow of only closing issues when they have actually been resolved. We can later come back to close this issue when it's no longer relevant and has thus been "resolved" because of it. I should add this case to ipfs/community#20

@whyrusleeping
Copy link
Member

thats a good idea, can you bring it up during the sprint meeting tomorrow?

@dylanPowers
Copy link
Member

I can try to remember to

@Kubuxu Kubuxu deleted the crypto-ed25519 branch February 27, 2017 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/commands Topic commands topic/repo Topic repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants