Avoid magic numbers
AnomalRoil opened this issue · 3 comments
AnomalRoil commented
These values (48, 32, 32) might change if we were to start using another curve than BLS12-381:
Lines 89 to 99 in 78dae76
Not sure what's the best solution:
- have them be const in a constant.go file?
- have a way to determine them from the encrypted file?
WDYT @nikkolasg ? Do we have them somewhere already as part of the current "scheme-name" drand is using? I don't think so.
nikkolasg commented
The length are present in the suite
https://github.com/drand/kyber/blob/master/group.go#L171-L174
So using the suite as in drand will make these generic over the curve's length
ardan-bkennedy commented
I have added constants for everything and included calculating the size of the PEM labels. If you decide to add these constants the code can be easily changed.
ardan-bkennedy commented
There are no more magic numbers. Everything has a constant.