mirror of https://github.com/status-im/nim-eth.git
more specific type check in `encryptGCM`
Narrowed the type of `encryptGCM`'s `key` parameter from `openarray[byte]` to `AesKey`, same as already used for `decryptGCM`.
This commit is contained in:
parent
9a1bb5e125
commit
172dad7968
|
@ -138,7 +138,7 @@ proc deriveKeys*(n1, n2: NodeID, priv: PrivateKey, pub: PublicKey,
|
|||
toOpenArray(res, 0, sizeof(secrets) - 1))
|
||||
secrets
|
||||
|
||||
proc encryptGCM*(key, nonce, pt, authData: openarray[byte]): seq[byte] =
|
||||
proc encryptGCM*(key: AesKey, nonce, pt, authData: openarray[byte]): seq[byte] =
|
||||
var ectx: GCM[aes128]
|
||||
ectx.init(key, nonce, authData)
|
||||
result = newSeq[byte](pt.len + gcmTagSize)
|
||||
|
|
Loading…
Reference in New Issue