Fixed compilation error
This commit is contained in:
parent
c3e78c28c3
commit
647660af02
|
@ -26,22 +26,22 @@ type
|
||||||
IncorrectKey, ## Recovered public key is invalid
|
IncorrectKey, ## Recovered public key is invalid
|
||||||
IncorrectTag ## ECIES tag verification failed
|
IncorrectTag ## ECIES tag verification failed
|
||||||
|
|
||||||
when false:
|
# when false:
|
||||||
# REVIEW(zah):
|
# # REVIEW(zah):
|
||||||
# Why do we work with arrays and known fixed offsets (such sa eciesIvPos)
|
# # Why do we work with arrays and known fixed offsets (such sa eciesIvPos)
|
||||||
# instead of defining object types with named fields:
|
# # instead of defining object types with named fields:
|
||||||
type
|
# type
|
||||||
EciesPrefix = object
|
# EciesPrefix = object
|
||||||
leadingByte: byte
|
# leadingByte: byte
|
||||||
pubKey: PublicKey
|
# pubKey: PublicKey
|
||||||
iv: array[aes128.sizeBlock]
|
# iv: array[aes128.sizeBlock]
|
||||||
|
|
||||||
# You can then write to these fields by doing:
|
# # You can then write to these fields by doing:
|
||||||
var eciesPrefix = cast[ptr EciesPrefix](addr array[0])
|
# var eciesPrefix = cast[ptr EciesPrefix](addr array[0])
|
||||||
eciesPrefix.pubKey = ...
|
# eciesPrefix.pubKey = ...
|
||||||
eciesPrefix.iv = ...
|
# eciesPrefix.iv = ...
|
||||||
|
|
||||||
# This will make the code slightly easier to read and review for correctness
|
# # This will make the code slightly easier to read and review for correctness
|
||||||
|
|
||||||
template eciesOverheadLength*(): int =
|
template eciesOverheadLength*(): int =
|
||||||
## Return data overhead size for ECIES encrypted message
|
## Return data overhead size for ECIES encrypted message
|
||||||
|
|
Loading…
Reference in New Issue