Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/c_hash_sig/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "c_hash_sig_crust"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

[lib]
Expand Down
12 changes: 9 additions & 3 deletions crates/c_hash_sig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,15 @@ All messages must be **exactly 32 bytes**. To sign longer messages, first use a
## Scheme Parameters

Current implementation uses:
- **Scheme**: Generalized XMSS (Winternitz encoding, w=4)
- **Hash function**: SHA-3 (SHAKE)
- **Lifetime**: 2^18 epochs (262,144 epochs)
- **Scheme**: Generalized XMSS (Target Sum encoding)
- **Scheme alias**: `SIGTopLevelTargetSumLifetime32Dim64Base8`
- **Hash function**: Poseidon2 (ZK-friendly)
- **Encoding**: Target Sum
- **Dimension**: 64
- **Base**: 8
- **Final Layer**: 77
- **Target Sum**: 375
- **Lifetime**: 2^32 epochs (4,294,967,296 epochs)
- **Message length**: 32 bytes

## Project Statistics
Expand Down
6 changes: 3 additions & 3 deletions crates/c_hash_sig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use std::os::raw::{c_char, c_int};
use std::ptr;
use std::slice;

use hashsig::signature::generalized_xmss::instantiations_sha::lifetime_2_to_the_18::winternitz::SIGWinternitzLifetime18W4;
use hashsig::signature::generalized_xmss::instantiations_poseidon_top_level::lifetime_2_to_the_32::hashing_optimized::SIGTopLevelTargetSumLifetime32Dim64Base8;
use hashsig::signature::{SignatureScheme, SignatureSchemeSecretKey};
use hashsig::MESSAGE_LENGTH;

// Type aliases for convenience
type SignatureSchemeType = SIGWinternitzLifetime18W4;
type SignatureSchemeType = SIGTopLevelTargetSumLifetime32Dim64Base8;
type PublicKeyType = <SignatureSchemeType as SignatureScheme>::PublicKey;
type SecretKeyType = <SignatureSchemeType as SignatureScheme>::SecretKey;
type SignatureType = <SignatureSchemeType as SignatureScheme>::Signature;
Expand Down Expand Up @@ -896,7 +896,7 @@ mod tests {
#[test]
fn test_get_lifetime() {
let lifetime = pq_get_lifetime();
assert_eq!(lifetime, 262144); // 2^18
assert_eq!(lifetime, 4294967296); // 2^32
}

#[test]
Expand Down
Loading