[os_crypto] avoid make -C due to bsd compatibility
[os_crypto] make some casts explicit
[os_crypto] fix some conversion warnings and reduce scope of global variables
[os_crypto] check snprintf call