formatting

This commit is contained in:
Dmitriy Ryajov 2020-04-07 09:48:47 -06:00
parent 976164ba3c
commit bd49a35e0a
1 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ const
ChaChaPolyKeySize = 32 ChaChaPolyKeySize = 32
ChaChaPolyNonceSize = 12 ChaChaPolyNonceSize = 12
ChaChaPolyTagSize = 16 ChaChaPolyTagSize = 16
type type
ChaChaPoly* = object ChaChaPoly* = object
ChaChaPolyKey* = array[ChaChaPolyKeySize, byte] ChaChaPolyKey* = array[ChaChaPolyKeySize, byte]
@ -46,7 +46,7 @@ proc intoChaChaPolyNonce*(s: openarray[byte]): ChaChaPolyNonce =
proc intoChaChaPolyTag*(s: openarray[byte]): ChaChaPolyTag = proc intoChaChaPolyTag*(s: openarray[byte]): ChaChaPolyTag =
assert s.len == ChaChaPolyTagSize assert s.len == ChaChaPolyTagSize
copyMem(addr result[0], unsafeaddr s[0], ChaChaPolyTagSize) copyMem(addr result[0], unsafeaddr s[0], ChaChaPolyTagSize)
# bearssl allows us to use optimized versions # bearssl allows us to use optimized versions
# this is reconciled at runtime # this is reconciled at runtime
# we do this in the global scope / module init # we do this in the global scope / module init
@ -85,7 +85,7 @@ proc decrypt*(_: type[ChaChaPoly],
unsafeaddr aad[0] unsafeaddr aad[0]
else: else:
nil nil
ourPoly1305CtmulRun( ourPoly1305CtmulRun(
unsafeaddr key[0], unsafeaddr key[0],
unsafeaddr nonce[0], unsafeaddr nonce[0],