Skip to main content

AP3 cryptographic operation implementations

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ap3_functions-1.2.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ap3_functions-1.2.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file ap3_functions-1.2.1.tar.gz.

File metadata

  • Download URL: ap3_functions-1.2.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.18

File hashes

Hashes for ap3_functions-1.2.1.tar.gz
Algorithm Hash digest
SHA256 5008de74a7ce90c448ef123aff5b30cda8c2a61179763afe121d2859dfcf1b8b
MD5 352cf8da744b44c82276a057184c34c5
BLAKE2b-256 bfd9df530d6ecfe085ae9cbd49cfabe6b04ca1c322eb1ecaec31eee6629ba4e0

See more details on using hashes here.

File details

Details for the file ap3_functions-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ap3_functions-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e28b4315dbe49221abf1772cb73f7957f6d50ec0977123bfab9a185caa20cd6a
MD5 38b9fdea93c91402dbce5304c5c2b101
BLAKE2b-256 21275761ef8760d08c4f9b3e12498b9bb570bc75e68bb327b61ba0b14c29bbd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page