@@ -19,7 +19,7 @@ const TAG_SIZE: usize = 16;
1919const CIPHERTEXT_OVERHEAD : usize = NONCE_SIZE + TAG_SIZE ; // 28 bytes
2020
2121#[ cfg( feature = "encryption" ) ]
22- use crate :: encryption:: { ZeroKnowledgeEncryptor , derive_domain_key } ;
22+ use crate :: encryption:: { derive_domain_key , ZeroKnowledgeEncryptor } ;
2323#[ cfg( feature = "encryption" ) ]
2424use crate :: ffi:: error:: CachekitError ;
2525#[ cfg( feature = "encryption" ) ]
@@ -77,7 +77,7 @@ use std::slice;
7777/// **RECOMMENDATION**: Store the encryptor handle in a global/singleton and reuse it.
7878/// Each handle supports 2^32 (~4 billion) encryptions before requiring a new key.
7979#[ cfg( feature = "encryption" ) ]
80- #[ unsafe ( no_mangle) ]
80+ #[ no_mangle]
8181pub unsafe extern "C" fn cachekit_encryptor_new (
8282 error_out : * mut CachekitError ,
8383) -> * mut CachekitEncryptor {
@@ -115,7 +115,7 @@ pub unsafe extern "C" fn cachekit_encryptor_new(
115115/// - `handle` must not be used after this call
116116/// - Function is panic-safe and will never unwind across FFI boundary
117117#[ cfg( feature = "encryption" ) ]
118- #[ unsafe ( no_mangle) ]
118+ #[ no_mangle]
119119pub unsafe extern "C" fn cachekit_encryptor_free ( handle : * mut CachekitEncryptor ) {
120120 let _ = catch_unwind ( || {
121121 // from_opaque_ptr handles null check and validity tracking
@@ -144,7 +144,7 @@ pub unsafe extern "C" fn cachekit_encryptor_free(handle: *mut CachekitEncryptor)
144144/// - `handle` must remain valid for duration of call
145145/// - Function is panic-safe and will never unwind across FFI boundary
146146#[ cfg( feature = "encryption" ) ]
147- #[ unsafe ( no_mangle) ]
147+ #[ no_mangle]
148148pub unsafe extern "C" fn cachekit_encryptor_get_counter ( handle : * const CachekitEncryptor ) -> u64 {
149149 let result = catch_unwind ( || {
150150 // as_ref handles null check and validity tracking
@@ -195,7 +195,7 @@ pub unsafe extern "C" fn cachekit_encryptor_get_counter(handle: *const CachekitE
195195///
196196/// Function is panic-safe and will never unwind across FFI boundary.
197197#[ cfg( feature = "encryption" ) ]
198- #[ unsafe ( no_mangle) ]
198+ #[ no_mangle]
199199pub unsafe extern "C" fn cachekit_encrypt (
200200 handle : * mut CachekitEncryptor ,
201201 key : * const u8 ,
@@ -324,7 +324,7 @@ pub unsafe extern "C" fn cachekit_encrypt(
324324///
325325/// Function is panic-safe and will never unwind across FFI boundary.
326326#[ cfg( feature = "encryption" ) ]
327- #[ unsafe ( no_mangle) ]
327+ #[ no_mangle]
328328pub unsafe extern "C" fn cachekit_decrypt (
329329 handle : * const CachekitEncryptor ,
330330 key : * const u8 ,
@@ -438,7 +438,7 @@ pub unsafe extern "C" fn cachekit_decrypt(
438438///
439439/// Function is panic-safe and will never unwind across FFI boundary.
440440#[ cfg( feature = "encryption" ) ]
441- #[ unsafe ( no_mangle) ]
441+ #[ no_mangle]
442442pub unsafe extern "C" fn cachekit_derive_key (
443443 master : * const u8 ,
444444 master_len : usize ,
0 commit comments