October 2019
Intermediate to advanced
444 pages
10h 37m
English
Let's repeat a few steps from the SHA256 library from the previous recipe:
[lib]name = "digest"crate-type = ["cdylib"][dependencies]libc = "0.2"ring = "0.14"
use std::ffi::{CStr, CString};use std::os::raw::c_char;use ring::digest;#[no_mangle]pub extern "C" fn digest(data: *mut c_char) -> *mut c_char { unsafe { let data = CStr::from_ptr(data); let signature = digest::digest(&digest::SHA256, ...Read now
Unlock full access