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

Conversation

@chfast
Copy link
Member

@chfast chfast commented Mar 13, 2017

No description provided.

@chfast chfast force-pushed the replace-cryptopp-ecies branch from 7d44a1d to c93edbb Compare March 13, 2017 12:53
@codecov-io
Copy link

codecov-io commented Mar 13, 2017

Codecov Report

Merging #3634 into master will increase coverage by 5.6%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master    #3634     +/-   ##
=========================================
+ Coverage   59.94%   65.55%   +5.6%     
=========================================
  Files         337      306     -31     
  Lines       27306    22666   -4640     
  Branches     3173        0   -3173     
=========================================
- Hits        16369    14858   -1511     
+ Misses       9857     7808   -2049     
+ Partials     1080        0   -1080
Impacted Files Coverage Δ
libp2p/RLPxHandshake.cpp 80.89% <ø> (+10.06%) ⬆️
libp2p/RLPXFrameCoder.h 50% <ø> (-50%) ⬇️
libethashseal/EthashAux.cpp 70.68% <ø> (ø)
test/unittests/libdevcrypto/crypto.cpp 95.88% <100%> (-0.52%) ⬇️
libdevcrypto/Common.cpp 92.52% <100%> (+11.68%) ⬆️
test/unittests/libp2p/rlpx.cpp 100% <100%> (ø) ⬆️
libethereum/CommonNet.h 0% <0%> (-100%) ⬇️
libethereum/VerifiedBlock.h 6.25% <0%> (-93.75%) ⬇️
libweb3jsonrpc/NetFace.h 0% <0%> (-90.91%) ⬇️
libweb3jsonrpc/Web3Face.h 0% <0%> (-87.5%) ⬇️
... and 394 more

@chfast chfast force-pushed the replace-cryptopp-ecies branch 2 times, most recently from 1af4f47 to f0f8ed5 Compare March 14, 2017 22:34
# Conflicts:
#	test/unittests/libdevcrypto/crypto.cpp
…cies

# Conflicts:
#	libdevcrypto/CryptoPP.cpp
#	libp2p/RLPXFrameCoder.h
#	test/unittests/libdevcrypto/crypto.cpp
#	test/unittests/libp2p/rlpx.cpp
@axic
Copy link
Member

axic commented Apr 25, 2017

Please add a test for PBKDF2 (maybe use these vectors http://stackoverflow.com/questions/5130513/pbkdf2-hmac-sha2-test-vectors). Also probably would be nicer to split the PBKDF2 change into a separate PR.

return;

bytes msg(1 + Public::size + h128::size + cipherText.size() + 32);
msg[0] = 0x04;
Copy link
Member

Choose a reason for hiding this comment

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

Probably I would create a helper which creates a SEC.1 key.

SEC.1 (http://www.secg.org/sec1-v2.pdf) section 2.3.3 describes the rules.

// interop w/go ecies implementation

// io_cipher[0] must be 2, 3, or 4, else invalidpublickey
if (_cipher.empty() || _cipher[0] < 2 || _cipher[0] > 4)
Copy link
Member

Choose a reason for hiding this comment

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

Probably better to have a class for SEC.1 key (mentioned above) and just use validations on that class here.

bytes io = _plain.toBytes();
Secp256k1PP::get()->encrypt(_k, io);
o_cipher = std::move(io);
encryptECIES(_k, _plain, o_cipher);
Copy link
Member

Choose a reason for hiding this comment

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

encrypt & decrypt are now the same as encryptECIES & decryptECIES, do we still need both?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will take a look. Probably not.

@chfast
Copy link
Member Author

chfast commented May 4, 2017

@axic requested some wrappers for Pubkey, Seckey to be added to handle conversion to/from secp256k1 library format nicely. I think it is good idea and I will start working on it soon.

@chfast chfast changed the base branch from develop to master August 2, 2018 08:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants