lthash 1.0.0

dotnet add package lthash --version 1.0.0
NuGet\Install-Package lthash -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="lthash" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add lthash --version 1.0.0
#r "nuget: lthash, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install lthash as a Cake Addin
#addin nuget:?package=lthash&version=1.0.0

// Install lthash as a Cake Tool
#tool nuget:?package=lthash&version=1.0.0

lthash

A C# implementation of LtHASH (Lattice Hash), a homomorphic hashing algorithm based on lattice cryptography introduced by Mihir Bellare and Daniele Micciancio in this paper. This is a simplified C# porting of the Facebook Folly C++ Library implementation of the algorithm introduced here.

Homomorphic Hashing

A homomorphic hash can simplistically be defined as a hash function such that one can compute the hash of a composite block from the hashes of the individual blocks or rather being f1 and f2 two hash functions and op1, op2 two operations it is true that:

f1(a op1 b) = f2(a) op2 f2(b)

One of the main building blocks of a homomorphic hashing function is therefore an underlying hash function (our f2). This project depends on this C# implementation of the BLAKE3 cryptographic hash function.

Example

var ltHash = new Lthash32();

// Create an initial checksum of two inputs
ltHash.Add(System.Text.Encoding.UTF8.GetBytes("apple"), System.Text.Encoding.UTF8.GetBytes("orange"));
var checksum = ltHash.GetChecksum();

// Remove the hash of "apple" from the checksum and check
// if the two checksums are equals
ltHash.Remove(System.Text.Encoding.UTF8.GetBytes("apple"));
var isEqual = ltHash.ChecksumEquals(checksum);

// Update the hash of "orange" with the new value "apple"
// and check if the two checksums are equals
ltHash.Update(System.Text.Encoding.UTF8.GetBytes("orange"), System.Text.Encoding.UTF8.GetBytes("apple"));
isEqual = ltHash.ChecksumEquals(checksum);

// Adding again the missing "orange" and check if the
// checksum is equal to the initial checksum
ltHash.Add(System.Text.Encoding.UTF8.GetBytes("orange"));
isEqual = ltHash.ChecksumEquals(checksum);
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 297 6/8/2021