(key, nonce)
| 19 | // ==================== AES-GCM ==================== |
| 20 | class AESGCMCipher { |
| 21 | constructor(key, nonce) { |
| 22 | if (key.length !== 16) throw new Error('key must be 16 bytes'); |
| 23 | if (nonce.length !== 8) throw new Error('nonce must be 8 bytes'); |
| 24 | this.key = key; |
| 25 | this.nonce = nonce; |
| 26 | this.encryptCounter = 1; |
| 27 | this.decryptCounter = 0; |
| 28 | } |
| 29 | |
| 30 | _makeIV(counter) { |
| 31 | const iv = Buffer.alloc(12); |
nothing calls this directly
no outgoing calls
no test coverage detected