Fast C++ PRINCE cipher backend for SPSDK IPED encryption.
Project description
SPSDK IPED - PRINCE Cipher Backend
High-performance C++ PRINCE cipher backend for SPSDK's IPED (Inline PRINCE Encryption/Decryption) module.
Installation
Prerequisites
A C++ compiler is required to build the native PRINCE cipher library:
- Linux/macOS: GCC or Clang (install via your package manager)
- Windows: MS Build Tools (instructions)
Install from source
pip install -e path/to/spsdk_plugins/iped
Install from Bitbucket
pip install git+ssh://git@bitbucket.sw.nxp.com/spsdk/spsdk_plugins.git#subdirectory=iped
Usage with SPSDK
When this package is installed, SPSDK's IPED module automatically detects the C++ backend and uses it for ~100-150x faster PRINCE cipher operations compared to the built-in pure-Python fallback.
No additional configuration is needed — just install the package alongside SPSDK.
Standalone usage
from spsdk_iped import IPED
# CTR mode encryption
cipher = IPED(key=0x01, address=0x80003000, iv=0x79EAFAB3A72412A1)
encrypted = cipher.encrypt(plaintext_bytes)
# Decryption
cipher2 = IPED(key=0x01, address=0x80003000, iv=0x79EAFAB3A72412A1)
decrypted = cipher2.decrypt(encrypted)
Performance
The C++ backend provides approximately 100-150x speedup over the pure-Python implementation:
| Backend | Throughput |
|---|---|
| Python (built-in) | ~0.03 MB/s |
| C++ (this package) | ~5 MB/s |
License
BSD-3-Clause
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file spsdk_iped-0.1.0.tar.gz.
File metadata
- Download URL: spsdk_iped-0.1.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41f6c75c058b71fbc15c5299d94d17d1069de405acca3dd231509b8851c982d0
|
|
| MD5 |
13364f0680067a0ff1fc477e16c84a35
|
|
| BLAKE2b-256 |
eead9536ddba8214735954641383c9933318ae0e6aac75264fc89168adfa36d5
|
Provenance
The following attestation bundles were made for spsdk_iped-0.1.0.tar.gz:
Publisher:
deploy.yml on nxp-mcuxpresso/spsdk_plugins
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spsdk_iped-0.1.0.tar.gz -
Subject digest:
41f6c75c058b71fbc15c5299d94d17d1069de405acca3dd231509b8851c982d0 - Sigstore transparency entry: 1870875253
- Sigstore integration time:
-
Permalink:
nxp-mcuxpresso/spsdk_plugins@6b289adfb8e6c7b61ea3f17dacedf1cab5f26850 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/nxp-mcuxpresso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@6b289adfb8e6c7b61ea3f17dacedf1cab5f26850 -
Trigger Event:
workflow_dispatch
-
Statement type: