Skip to main content

ap3-functions

Protocol implementations for the AP3 (Agent Privacy-Preserving Protocol) SDK.

ap3-functions ships the cryptographic operation implementations (currently PSI — Private Set Intersection) that the core ap3 SDK composes into end-to-end privacy-preserving agent workflows.

Installation

pip install ap3-functions

This pulls in ap3 automatically.

Usage

from ap3_functions import PSIOperation

initiator = PSIOperation()   # OB: customer holder
receiver  = PSIOperation()   # BB: sanction list holder

# 4-envelope flow: init → msg0 → msg1 → msg2.
# OB commits sid_0 (hidden) in init; BB reveals sid_1 in msg0; OB opens the
# commit and sends psc_msg1 in msg1. session_id = H(sid_0, sid_1).
init  = initiator.start(role="initiator", inputs={"customer_data": "John Doe,ID123"})
msg0  = receiver.receive(role="receiver", message=init["outgoing"], config={"sanction_list": [...]})
msg1  = initiator.process(session_id=init["session_id"],  message=msg0["outgoing"])
msg2  = receiver.process(session_id=msg0["session_id"],  message=msg1["outgoing"])
final = initiator.process(session_id=init["session_id"], message=msg2["outgoing"])
is_match = final["result"]["is_match"]

Most callers use PrivacyAgent.run_intent() instead, which drives the exchange end-to-end over A2A.

Distribution name is ap3-functions (hyphenated), import name is ap3_functions (underscored). This is standard Python packaging convention — the same way pip install scikit-learn gives you import sklearn-style decoupling.

See the AP3 SDK docs for the full API and end-to-end examples.

Platform support

PSI is implemented in pure Python on top of rbcl (libsodium / Ristretto255) and merlin_transcripts (Fiat–Shamir).

It runs anywhere those wheels install — macOS, Linux, and Windows on both x86_64 and arm64.

License

Apache-2.0

Metadata

Release files for ap3-functions 1.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ap3-functions 1.2.3
File Size Uploaded
ap3_functions-1.2.3.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ap3-functions 1.2.3
File Interpreter ABI Platform
ap3_functions-1.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 21.9 kB

Release files / ap3_functions-1.2.3.tar.gz

Download URL ap3_functions-1.2.3.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
324184c29db7970627ed49ceefcd86181492435210cde143db8ea48470b83768
BLAKE2b-256 checksum
How to use checksums
0142ff4de28af1d37de62c7b671ee3ff913797f58449502e1203bb8902bb3d0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / ap3_functions-1.2.3-py3-none-any.whl

Download URL ap3_functions-1.2.3-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
849b8bdfb43e609c8094afe339340f07774a36971d3c4f7a17f630ac2dd51ed8
BLAKE2b-256 checksum
How to use checksums
e9e6c1ea663ef19c55f06bbc77f6bae2255b691a7feb8d5e94d7484ea14b4e7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.2.3 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page