dusk-poseidon 0.42.0

Implementation of Poseidon hash algorithm over the Bls12-381 Scalar field.
BLS_BACKEND ?= bls-backend-blst
NOSTD_BLS_BACKEND ?= bls-backend-dusk
FEATURES := zk,encryption,$(BLS_BACKEND)

help: ## Display this help screen
	@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

test: ## Run tests (release mode, BLST backend by default)
	@cargo test --features=$(FEATURES) --release
	@cargo test --features=encryption,$(BLS_BACKEND) --release --no-run

clippy: ## Run clippy
	@cargo clippy --features=$(FEATURES) -- -D warnings
	@cargo clippy --no-default-features --features=$(BLS_BACKEND) -- -D warnings

cq: ## Run code quality checks (formatting + clippy)
	@$(MAKE) fmt CHECK=1
	@$(MAKE) clippy

fmt: ## Format code
	@rustup component add --toolchain nightly rustfmt 2>/dev/null || true
	@cargo +nightly fmt --all $(if $(CHECK),-- --check,)

check: ## Type-check
	@cargo check --features=$(FEATURES)

doc: ## Generate docs
	@cargo doc --no-deps --features=$(FEATURES)

clean: ## Clean build artifacts
	@cargo clean

no-std: ## Verify no_std bare-metal build
	@rustup target add thumbv6m-none-eabi 2>/dev/null || true
	@cargo build --release --no-default-features --features=$(NOSTD_BLS_BACKEND) --target thumbv6m-none-eabi

.PHONY: help test clippy cq fmt check doc clean no-std