Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/Pyrinpyi/go-muhash

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Pyrinpyi/go-muhash

  • v1.0.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

go-muhash

Warning: This is pre-alpha software. The code has not been audited and/or reviewed by anyone other than the author.

ISC License GoDoc

go-muhash implements a rolling hash function using a multiplicative hash.
it is based on a multiplicative group over Z=2^3072-1103717 using multiplication and division for adding/removing elements from the hash function.
the current code is heavily based on: https://github.com/bitcoin/bitcoin/blob/a1fcceac69097a8e6540a6fd8121a5d53022528f/src/crypto/muhash.cpp (written by Pieter Wuille, MIT licensed)
But uses BLAKE2B as the hash function and Go's standard library big.Int for fast modular inversions(GCD)

MuHash is the public interface implementing Add/Remove elements functions, and a Finalize function to return a final hash.

uint3072.go is a go implementation of the multiplicative group
num3072.c/h is a C implementation of the multiplicative group
num3072.go is go bindings for the C imlementation

Ideally we will add Go Assembly implementations using SSE2/SSE4.1/AVX and will choose the correct one in runtime, this should also remove the cgo overhead.

Tests

./build_and_test.sh will run all the tests and checks in this library.
./fuzz.sh will run the fuzzer and put new corpus in the corpus directory. by default, it will use go-fuzz But if you run with LIBFUZZER=1 ./fuzz.sh it will run it with libfuzzer
All the current corpus are checked in the unit test in fuzz_corpuses_test.go (requires -tags=gofuzz)

FAQs

Package last updated on 05 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc