coffio 0.1.0

Abstraction layer for symmetric data encryption, primarily designed for database column encryption.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub(crate) fn blake3_derive(context: &str, ikm: &[u8]) -> Vec<u8> {
	blake3::derive_key(context, ikm).to_vec()
}

#[cfg(test)]
mod tests {
	#[test]
	fn blake3_derive() {
		assert_eq!(
			super::blake3_derive("this is a context", b"7b47db8f365e5b602fd956d35985e9e1"),
			vec![
				0xc4, 0xf4, 0x6c, 0xf2, 0x03, 0xd9, 0x2d, 0x7b, 0x72, 0xe8, 0xe7, 0x90, 0xa3, 0x62,
				0x2a, 0xf4, 0x3c, 0x2a, 0xab, 0x27, 0xc6, 0xb1, 0x8b, 0x46, 0x9d, 0x40, 0x61, 0x56,
				0x19, 0x76, 0x88, 0xc4
			]
		);
	}
}