> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inco.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Library Reference

> API reference for the Inco Rust Crate

# Library Reference

Complete API reference for the Inco Lightning SDK.

<CardGroup cols={3}>
  <Card title="Types" icon="cube" href="/svm/rust-sdk/types">
    Encrypted data types and input functions
  </Card>

  <Card title="Operations" icon="calculator" href="/svm/rust-sdk/operations">
    Arithmetic, comparison, bitwise, and control flow
  </Card>

  <Card title="Account Structs" icon="users" href="/svm/rust-sdk/accounts">
    CPI account structures for operations
  </Card>
</CardGroup>

## Quick Reference

### Types

| Type       | Description                                  |
| ---------- | -------------------------------------------- |
| `Euint128` | Handle to encrypted unsigned 128-bit integer |
| `Ebool`    | Handle to encrypted boolean                  |

### Input Functions

| Function       | Description                                |
| -------------- | ------------------------------------------ |
| `new_euint128` | Create encrypted u128 from ciphertext      |
| `new_ebool`    | Create encrypted bool from ciphertext      |
| `as_euint128`  | Convert plaintext u128 to encrypted handle |
| `as_ebool`     | Convert plaintext bool to encrypted handle |

### Operations

| Function                                   | Description              |
| ------------------------------------------ | ------------------------ |
| `e_add`                                    | Addition                 |
| `e_sub`                                    | Subtraction              |
| `e_mul`                                    | Multiplication           |
| `e_rem`                                    | Remainder                |
| `e_ge`, `e_gt`, `e_le`, `e_lt`, `e_eq`     | Comparisons              |
| `e_and`, `e_or`, `e_not`, `e_shl`, `e_shr` | Bitwise                  |
| `e_rand`                                   | Random number generation |
| `e_select`                                 | Conditional selection    |

### Access Control

| Function            | Description                    |
| ------------------- | ------------------------------ |
| `allow`             | Grant/revoke decryption access |
| `is_allowed`        | Check decryption permission    |
| `is_validsignature` | Verify attestation signatures  |

<Warning>
  Every operation that produces a new handle requires calling `allow()` to grant decryption access. Use the `remaining_accounts` pattern to pass allowance PDAs and grant access in the same transaction. See [Access Control](/svm/guide/access-control) for simulation patterns.
</Warning>

### Account Structs

| Struct            | Used For                 |
| ----------------- | ------------------------ |
| `Operation`       | All encrypted operations |
| `Allow`           | Granting/revoking access |
| `IsAllowed`       | Checking permissions     |
| `VerifySignature` | Attestation verification |
