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

[WIP] Add GRS support #333

Closed
wants to merge 1 commit into from

Conversation

yura-pakhuchiy
Copy link
Contributor

@yura-pakhuchiy yura-pakhuchiy commented Apr 2, 2018

This work-in-progress PR together with trezor/trezor-crypto#144 adds support for Groestlcoin (GRS). However ATM it breaks support for other coins. I'm opening this PR to ask how it is better to integrate GRS specific changes.

GRS uses signle SHA256 instead of double SHA256 for transaction and message signing. How it is better to check whether we should use double or signle SHA256? Should I add new field "double_sha256_signing" to coins.json. Or just check coin name with strcmp? Or any other way?

@prusnak
Copy link
Member

prusnak commented Apr 2, 2018

I suggest to look at Decred pull request and how it uses the concept of Hashers to achieve the similar thing. #274

@prusnak prusnak added the altcoin label Apr 2, 2018
@yura-pakhuchiy
Copy link
Contributor Author

yura-pakhuchiy commented Apr 2, 2018

@prusnak Yes, I'm using Hashers in trezor/trezor-crypto#144 to add Groestl hash. However I'm not sure how can they help in single-SHA256 vs double-SHA256 changes in this PR. Are you suggesting to add new hasher which always performs single SHA256 even if hasher_Double() was called?

#274 uses if (coin->decred) a lot. Can I add similar flag for single vs double SHA256?

@prusnak
Copy link
Member

prusnak commented Apr 2, 2018

@saleemrashid any ideas? I dislike the idea of adding another flag, because GRS does not bring anything new, just different hashing. And using a single hash even when hasher_Double is called, sounds hackish ...

@saleemrashid
Copy link
Contributor

@yura-pakhuchiy
Copy link
Contributor Author

No longer needed, now all required changes are in trezor/trezor-crypto#148

@gruve-p
Copy link

gruve-p commented Apr 17, 2018

Thanks for the clarification @yura-pakhuchiy

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants