#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

#491 in Cryptography

Download history 7581/week @ 2024-03-14 2355/week @ 2024-03-21 19252/week @ 2024-03-28 3149/week @ 2024-04-04 4348/week @ 2024-04-11 4579/week @ 2024-04-18 4355/week @ 2024-04-25 3075/week @ 2024-05-02 2478/week @ 2024-05-09 10589/week @ 2024-05-16 10215/week @ 2024-05-23 3960/week @ 2024-05-30 10318/week @ 2024-06-06 6036/week @ 2024-06-13 6225/week @ 2024-06-20 8012/week @ 2024-06-27

31,587 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
~96K SLoC