(t *testing.T)
| 53 | } |
| 54 | |
| 55 | func TestDecrypt_TruncatedCiphertext(t *testing.T) { |
| 56 | key := make([]byte, 32) |
| 57 | |
| 58 | // "AAAAAA==" decodes to 4 bytes, which is less than the 12-byte AES-GCM nonce size. |
| 59 | // This tests the "ciphertext too short" error path. |
| 60 | _, err := Decrypt("enc:AAAAAA==", key) |
| 61 | assert.Error(t, err) |
| 62 | } |
| 63 | |
| 64 | func TestDecrypt_WrongKey(t *testing.T) { |
| 65 | key1 := make([]byte, 32) |