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

Differences from SEC 1 in ethereum ECIES #473

Closed
devrandom opened this issue Mar 12, 2015 · 7 comments
Closed

Differences from SEC 1 in ethereum ECIES #473

devrandom opened this issue Mar 12, 2015 · 7 comments

Comments

@devrandom
Copy link

I wanted to list the differences from SEC 1 that I found while working on ECIES for ethereumj. SEC 1 says:

  • IV should be all zeros and should not be transmitted (see section 3.8 discussion about IV/ICB)
  • IV should not be part of MAC (message tag) computation
  • also noticed an extra hash of the MAC key in the go-ethereum implementation

I believe that the reason SEC 1 recommends constant IV is that the ephemeral key is used only once, so use of a random IV is superfluous.

The changes don't seem to introduce any weakness, just curious about the motivation.

( @romanman )

@romanman
Copy link
Contributor

@obscuren : I know you are busy, but in a moment you not, can
you comment on this please or refer to somebody in your team.

@fjl
Copy link
Contributor

fjl commented Mar 13, 2015

I will have a look at it later.

@fjl fjl self-assigned this Mar 13, 2015
@Gustav-Simonsson
Copy link

@romanman Hi! Apologies for the late reply - we've been so busy with other parts of Ethereum lately :)

Section 3.8 in SEC 1 Version 2.0 specifies zeroed IV for TDES in CBC mode and for AES in CBC and CTR modes, but it does not specify what IV value to use for plain XOR CTR.

The Go implementation uses XOR CTR: https://github.com/ethereum/go-ethereum/blob/develop/crypto/ecies/ecies.go#L193

You're right that IV should not be transmitted as part of the ciphertext, as specified in SEC 1.

While the IV value is not specified for XOR CTR, it's implied it cannot be random if it should not be transmitted as part of the ciphertext, as then the other party cannot know it.

If it's non-random, we can set it to the zeroed value defined for AES in CTR mode.

It's correct that IV should not be part of the message to take MAC over, defined as concatenation of ciphertext and "SharedInfo2" in section 5.1.3 step 8.

The extra hashing of the MAC key is indeed not specified in SEC 1 and can be removed.

Pull request: #847

@fjl @subtly Please review - if this is correct C++ would also need to be updated to be compatible.

SEC1: http://www.secg.org/sec1-v2.pdf

@subtly
Copy link
Member

subtly commented May 11, 2015

@romanman @Gustav-Simonsson This stems from adopting the go ecies package. This would go well with the adoption of libsecp256k1 multiply within ecies. Would be good to ping the upstream author about that as well.

@enuoCM
Copy link

enuoCM commented Sep 4, 2017

What's the status of this issue now? So we cannot make ecies work between ethereumj and go-etherum now?

update: ECIESCoder of ethereumj works well with the go-ethereum ecies.

@jian1098
Copy link

I got an error “panic: got null header for uncle 0 of block 1458046c19b4c0e388db6cb7d09c3da6a8a88e75ccf9f027196c2732d43c9b6b” when i run 'range block.Transactions()',what should i do when it happen????

@fjl
Copy link
Contributor

fjl commented Mar 5, 2019

It's way too late to align ECIES used in Ethereum p2p with any standard. New APIs for encryption have been proposed for the RPC interface but we haven't implemented them yet.

@fjl fjl closed this as completed Mar 5, 2019
ngtuna added a commit to ngtuna/tomochain that referenced this issue Mar 22, 2019
maoueh pushed a commit to streamingfast/go-ethereum that referenced this issue Nov 12, 2021
maoueh pushed a commit to streamingfast/go-ethereum that referenced this issue Jun 9, 2023
maoueh pushed a commit to streamingfast/go-ethereum that referenced this issue Jun 9, 2023
* Create MVHashMap and use it StateDB

* Parallel state processor

* Move fee burning and tipping out of state transition to reduce read/write dependencies between transactions

* Re-execute parallel tasks when there is a read in coinbase or burn address

* Block-stm optimization

Added tests for executor and two major improvements:

1. Add a dependency map during execution. This will prevent aborted tasks from being sent for execution immedaitely after failure.
2. Change the key of MVHashMap from string to a byte array. This will reduce time to convert byte slices to strings.

* Remove cache from executor test

* added mvhashmap unit tests (with  as key)

* Shard mvhashmap to reduce the time spent in global mutex

* Skip applying intermediate states

* Dependency improvement

* added test for status

* Create MVHashMap and use it StateDB

* Parallel state processor

* Move fee burning and tipping out of state transition to reduce read/write dependencies between transactions

* Re-execute parallel tasks when there is a read in coinbase or burn address

* Txn prioritizer implemented using mutex map (ethereum#487)

* basic txn prioritizer implemented using mutex map

* Re-execute parallel tasks when there is a read in coinbase or burn address

* Re-execute parallel tasks when there is a read in coinbase or burn address

* using *sync.RWMutex{} in mutexMap

Co-authored-by: Jerry <jerrycgh@gmail.com>

* added getReadMap and getWriteMap (ethereum#473)

* Block-stm optimization

Added tests for executor and some improvements:

1. Add a dependency map during execution. This will prevent aborted tasks from being sent for execution immedaitely after failure.
2. Change the key of MVHashMap from string to a byte array. This will reduce time to convert byte slices to strings.
3. Use sync.Map to reduce the time spent in global mutex.
4. Skip applying intermediate states.
5. Estimate dependency when an execution fails without dependency information.
6. Divide execution task queue into two separate queues. One for relatively certain transactions, and the other for speculative future transactions.
7. Setting dependencies of Txs coming from the same sender before starting parallel execution.
8. Process results in their semantic order (transaction index) instead of the order when they arrive. Replace result channel with a priority queue.

* Do not write entire objects directly when applying write set in blockstm

* fixed a small bug in the Report function (ethereum#530)

* linters

Co-authored-by: Jerry <jerrycgh@gmail.com>
tanishqjasoria pushed a commit to tanishqjasoria/go-ethereum that referenced this issue Oct 31, 2023
* fix: use Feevault address in the EVM BlockContext

* bump version

* revert format change

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants