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.0.tar.gz (9.1 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.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ap3_functions-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c8a1297d32fbfdbb9af8ddd26542f7c0e1dc31e99c8983a3fee73a94f3a438b5
MD5 2e7b41c628b2c24938e90f0ae6d38212
BLAKE2b-256 314dda0113db58cc76a17c32ffe827c26ca3441eb8764a1f7bf721dc19438b81

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ap3_functions-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6f8669cb1beeac7fbfd7384513202836a3b4b78ae39d1173837cc5097f6bcf2
MD5 36d61e50d758353ee4eb51a2a482c923
BLAKE2b-256 00a39e6283bda6d9db1fc54dbd40e1c94ec96da3cf53fd9fb7f400051b1cd22b

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