SPECT Compiler
July 10, 2025 ยท View on GitHub
This repository presents SPECT, a domain specific processor designed for performing calculations related to Elliptic Curve Cryptography (ECC). SPECT offers dedicated instructions for operations involving 256-bit numbers and modular arithmetic, making it useful for implementing algorithms like:
- ECDSA (Elliptic Curve Digital Signature Algorithm)
- ECDH (Elliptic Curve Diffie-Hellman).
Documentation
Programmer's Guide
ISA (Instruction Set Architecture):
Dependencies
The ts-spect-compiler has following dependencies:
- cmake
- C++ compiler
- Python3.8 (or higher)
- Xlstproc
- jinja2 python package
To install the dependencies:
sudo apt-get install cmake build-essentials python3 python3-pip xsltproc
Then, to install jinja2:
pip install jinja2
Build Instructions
Follow these steps to build SPECT from source with CMake:
-
Clone the Repository:
First, recursively clone the SPECT repository to your local machine:
git clone https://github.com/tropicsquare/ts-spect-compiler.git --recurse-submodules cd ts-spect-compiler # Navigate to the repository directory -
Build SPECT:
Use the provided
build.shscript to build SPECT with CMake:./build.sh --cleanThis script will compile SPECT and generate binaries for the compiler
spect_compilerand the instruction set simulatorspect_issin the default build directory, which isbuild/src/apps. -
Make the Binaries Executable (Optional):
If necessary, make the generated binaries executable as follows:
chmod +x build/src/apps/spect_compiler chmod +x build/src/apps/spect_iss -
Optional: Add Binaries to $PATH (Convenient Access):
To easily access these binaries from anywhere, you can add their directory to your system's
$PATH:export PATH="${PATH}:$(pwd)/build/src/apps/"You can also add this line to your shell configuration file (e.g.,
~/.bashrcor~/.zshrc) to make the changes persistent. -
Run the Binaries:
Finally, you can run the SPECT compiler and instruction set simulator using the following commands:
spect_compiler --help spect_iss --help
Contribution and Pull Requests
We appreciate your interest in contributing to the SPECT compiler! Currently, we are not accepting pull requests.