# README
Polarys Mixing 256 (pM-256) Hashing Protocol
The Polarys Mixing 256 (pM-256) hashing protocol is a secure cryptographic hash function designed to provide resistance to preimage, second preimage, and collision attacks. It features an advanced mixing function that utilizes large prime constants, bitwise rotations, and modular arithmetic to ensure good diffusion and non-linearity across the hash state. The protocol is designed for efficient processing of input data in 128-byte blocks and is suitable for use in cryptographic applications such as digital signatures (ECDSA) or key derivation (ECDH).
Key Features
- Initialization: Constants based on secure IVs (Initial Vectors)
- Advanced Mixing: Uses 64-bit operations like rotations, XORs, and large prime multiplications
- Cryptographic Finalization: Further strengthens the state to ensure cryptographic security
- High Resistance: Designed to resist common cryptographic attacks (preimage, second preimage, collision)
Installation
To install the dependencies for this project, run:
go get github.com/polarysfoundation/pm-256
Usage
Hashing Data
To hash data using the pM-256 protocol, use the Sum256 function:
package main
import (
"fmt"
"github.com/polarysfoundation/pm-256"
)
func main() {
data := []byte("Hello, Polarys Mixing 256!")
hash := pm256.Sum256(data)
fmt.Printf("Hash: %x\n", hash)
}
Running Tests
To run the tests for the pM-256 hashing protocol, use the following command:
go test -v
Benchmarking
To benchmark the hashing performance, use the following command:
go test -bench .
Project Structure
- hasher.go: Contains the core implementation of the Polarys Mixing 256 (pM-256) hashing protocol.
- pM-256.go: Implements the Polarys256 struct and related methods for hashing.
- pM-256_test.go: Contains tests and benchmarks for the pM-256 hashing protocol.
- go.mod: Go module file specifying dependencies. go.sum: Go module checksum file.
License
This project is licensed under the MIT License. See the LICENSE file for details.