#tink #prf

tink-prf

PRF functionality for Rust port of Google's Tink cryptography library

8 releases

0.2.5 Mar 14, 2023
0.2.4 Mar 25, 2022
0.2.3 Jan 3, 2022
0.2.1 Oct 8, 2021
0.1.0 Jan 21, 2021

#509 in Cryptography

Download history 4941/week @ 2024-07-04 2326/week @ 2024-07-11 3385/week @ 2024-07-18 2341/week @ 2024-07-25 3366/week @ 2024-08-01 7035/week @ 2024-08-08 5304/week @ 2024-08-15 13135/week @ 2024-08-22 8346/week @ 2024-08-29 9637/week @ 2024-09-05 6223/week @ 2024-09-12 9810/week @ 2024-09-19 17226/week @ 2024-09-26 4874/week @ 2024-10-03 10227/week @ 2024-10-10 11073/week @ 2024-10-17

43,774 downloads per month
Used in 6 crates (2 directly)

Apache-2.0

260KB
4.5K SLoC

Tink-Rust: Pseudo-Random Functions

Docs MSRV

This crate provides pseudo-random function (PRF) functionality, as described in the upstream Tink documentation.

Usage

fn main() -> Result<(), Box<dyn Error>> {
    tink_prf::init();
    let kh = tink_core::keyset::Handle::new(&tink_prf::hmac_sha256_prf_key_template())?;
    let m = tink_prf::Set::new(&kh)?;

    let pt = b"need pseudo-random data deterministically produced from this input";
    let out = m.compute_primary_prf(pt, 16)?;
    println!("'{}' => {}", String::from_utf8_lossy(pt), hex::encode(&out));
    assert_eq!(out.len(), 16);
    Ok(())
}

License

Apache License, Version 2.0

Disclaimer

This is not an officially supported Google product.

Dependencies

~3–5.5MB
~98K SLoC