Registry / crypto / ghash
library0.6.0rscratesunverified

Universal hash over GF(2^128) useful for constructing a Message Authentication Code (MAC), as in the AES-GCM authenticated encryption cipher.

# Cargo.toml [dependencies] ghash = "0.6.0"
INSTALL
IMPORT
SIG · GHASH
G
ghash
cryptorustv0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GHash
use ghash::GHash;

Computes a GHASH tag for given data using a 128-bit key.

use ghash::GHash; use hex_literal::hex; let key = hex!("000102030405060708090a0b0c0d0e0f"); let ghash = GHash::new(&key.into()); let data = b"hello"; let tag = ghash.compute(data); println!("Tag: {:?}", tag);
Debug
Known issues
gotchaGHASH is not a secure MAC by itself; it requires a cipher like AES to form AES-GCM.
fix
Use in conjunction with AES as part of AES-GCM, not standalone for authentication.
affects: *
Upgrade
Version history
0.6.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
ghash — cargo add ghash · libregistry