diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-10-01 20:37:26 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-10-01 20:37:26 -0700 |
| commit | 8f3927cc91b8f9dcc2bd3e05c2ddd225a92c96dc (patch) | |
| tree | b86c45195236428f58ec2883a81c53f317532fe7 /internal | |
| parent | 298f4b4634026f268ad74dadccbca8127ab83076 (diff) | |
| download | roseh.moe-8f3927cc91b8f9dcc2bd3e05c2ddd225a92c96dc.tar.zst | |
Linked list is cool, but have you heard of array
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/cryptoutil/oae2.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/cryptoutil/oae2.go b/internal/cryptoutil/oae2.go index 4e667b7..8eb18fb 100644 --- a/internal/cryptoutil/oae2.go +++ b/internal/cryptoutil/oae2.go @@ -35,7 +35,7 @@ type oae2 struct { additionalData []byte aead cipher.AEAD - i uint64 + i int64 noncePrefix [noncePrefixSize]byte } @@ -56,10 +56,10 @@ func (o *oae2) initialize(header []byte) error { func (o *oae2) nonce(nonce []byte, lastBlock bool) error { copy(nonce, o.noncePrefix[:]) - if o.i == 0 { + if o.i < 0 { return errors.New("counter overflowed (64 bits??)") } - binary.BigEndian.PutUint64(nonce[noncePrefixSize:], o.i) + binary.BigEndian.PutUint64(nonce[noncePrefixSize:], uint64(o.i)) if lastBlock { nonce[gcmNonceSize-1] = 1 } |
