{
  "classes": [
    {
      "constants": [],
      "types": [],
      "name": "@eryx/crypto/camellia",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 35
          },
          "is_method": false,
          "signature": "camellia.encryptCBC(\n    key: buffer,  -- Key - 16, 24, or 32 bytes (128/192/256-bit).\n    iv: buffer,  -- Initialisation vector - 16 bytes.\n    data: buffer  -- Plaintext to encrypt.\n) → (\n    buffer  -- Ciphertext. \n)",
          "owner": "camellia",
          "desc": "Encrypts `data` with Camellia-CBC (PKCS#7 padding).\n",
          "tags": [],
          "name": "encryptCBC",
          "return_str": "buffer",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Ciphertext. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "key",
              "desc": "Key - 16, 24, or 32 bytes (128/192/256-bit)."
            },
            {
              "lua_type": "buffer",
              "name": "iv",
              "desc": "Initialisation vector - 16 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "data",
              "desc": "Plaintext to encrypt."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 47
          },
          "is_method": false,
          "signature": "camellia.decryptCBC(\n    key: buffer,  -- Key - 16, 24, or 32 bytes.\n    iv: buffer,  -- Initialisation vector - 16 bytes.\n    data: buffer  -- Ciphertext to decrypt.\n) → (\n    buffer  -- Plaintext. \n)",
          "owner": "camellia",
          "desc": "Decrypts Camellia-CBC ciphertext (strips PKCS#7 padding).\n",
          "tags": [],
          "name": "decryptCBC",
          "return_str": "buffer",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Plaintext. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "key",
              "desc": "Key - 16, 24, or 32 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "iv",
              "desc": "Initialisation vector - 16 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "data",
              "desc": "Ciphertext to decrypt."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 59
          },
          "is_method": false,
          "signature": "camellia.encryptCTR(\n    key: buffer,  -- Key - 16, 24, or 32 bytes.\n    iv: buffer,  -- Counter/nonce block - 16 bytes.\n    data: buffer  -- Plaintext to encrypt.\n) → (\n    buffer  -- Ciphertext (same length as input). \n)",
          "owner": "camellia",
          "desc": "Encrypts `data` with Camellia-CTR (stream cipher; no padding).\n",
          "tags": [],
          "name": "encryptCTR",
          "return_str": "buffer",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Ciphertext (same length as input). "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "key",
              "desc": "Key - 16, 24, or 32 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "iv",
              "desc": "Counter/nonce block - 16 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "data",
              "desc": "Plaintext to encrypt."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 71
          },
          "is_method": false,
          "signature": "camellia.decryptCTR(\n    key: buffer,  -- Key - 16, 24, or 32 bytes.\n    iv: buffer,  -- Counter/nonce block - 16 bytes.\n    data: buffer  -- Ciphertext to decrypt.\n) → (\n    buffer  -- Plaintext (same length as input). \n)",
          "owner": "camellia",
          "desc": "Decrypts Camellia-CTR ciphertext.\n",
          "tags": [],
          "name": "decryptCTR",
          "return_str": "buffer",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Plaintext (same length as input). "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "key",
              "desc": "Key - 16, 24, or 32 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "iv",
              "desc": "Counter/nonce block - 16 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "data",
              "desc": "Ciphertext to decrypt."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 87
          },
          "is_method": false,
          "signature": "camellia.encryptGCM(\n    key: buffer,  -- Key - 16, 24, or 32 bytes.\n    nonce: buffer,  -- Nonce - 12 bytes recommended.\n    data: buffer,  -- Plaintext to encrypt.\n    aad: buffer?  -- Additional authenticated data (optional).\n) → (\n    buffer,  -- Ciphertext.\n    buffer  -- 16-byte authentication tag. \n)",
          "owner": "camellia",
          "desc": "Encrypts `data` with Camellia-GCM (authenticated encryption).\n\nReturns ciphertext and authentication tag separately.\n",
          "tags": [],
          "name": "encryptGCM",
          "return_str": "(buffer, buffer)",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Ciphertext."
            },
            {
              "lua_type": "buffer",
              "desc": "16-byte authentication tag. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "key",
              "desc": "Key - 16, 24, or 32 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "nonce",
              "desc": "Nonce - 12 bytes recommended."
            },
            {
              "lua_type": "buffer",
              "name": "data",
              "desc": "Plaintext to encrypt."
            },
            {
              "lua_type": "buffer?",
              "name": "aad",
              "desc": "Additional authenticated data (optional)."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 103
          },
          "is_method": false,
          "signature": "camellia.decryptGCM(\n    key: buffer,  -- Key - 16, 24, or 32 bytes.\n    nonce: buffer,  -- Nonce - must match the value used during encryption.\n    ct: buffer,  -- Ciphertext.\n    tag: buffer,  -- 16-byte authentication tag.\n    aad: buffer?  -- Additional authenticated data (must match encryption).\n) → (\n    buffer  -- Plaintext. \n)",
          "owner": "camellia",
          "desc": "Decrypts Camellia-GCM ciphertext and verifies the authentication tag.\n\nRaises an error if the tag does not match.\n",
          "tags": [],
          "name": "decryptGCM",
          "return_str": "buffer",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Plaintext. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "key",
              "desc": "Key - 16, 24, or 32 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "nonce",
              "desc": "Nonce - must match the value used during encryption."
            },
            {
              "lua_type": "buffer",
              "name": "ct",
              "desc": "Ciphertext."
            },
            {
              "lua_type": "buffer",
              "name": "tag",
              "desc": "16-byte authentication tag."
            },
            {
              "lua_type": "buffer?",
              "name": "aad",
              "desc": "Additional authenticated data (must match encryption)."
            }
          ]
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "Camellia symmetric encryption.\n\nCamellia is an ISO/IEC 18033-3 and NESSIE-approved block cipher with\nthe same block and key sizes as AES (128/192/256-bit keys, 128-bit\nblock). It is a recognised alternative to AES in TLS and IPsec.\n\nSupports CBC, CTR, and GCM modes - see `@eryx/crypto/aes` for\nmode descriptions. CCM is not defined for Camellia in PSA Crypto.\n\n```luau\nlocal camellia = require(\"@eryx/crypto/camellia\")\n\nlocal key   = buffer.fromstring(\"0123456789abcdef\")  -- 16-byte / 128-bit\nlocal iv    = buffer.fromstring(\"0000000000000000\")\nlocal plain = buffer.fromstring(\"Hello, Camellia!\")\n\nlocal ct = camellia.cbc_encrypt(key, iv, plain)\nlocal pt = camellia.cbc_decrypt(key, iv, ct)\n```\n"
    }
  ]
}