mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-07 15:36:26 +00:00
crypto light refactoring.
using volatile f/p guaranting assembly will generate call* instruction on memset for secure buffer zeroing. usage in sha1 api as well.
This commit is contained in:
parent
c646476ca8
commit
1f93fc902b
5 changed files with 13 additions and 19 deletions
|
|
@ -27,19 +27,12 @@
|
|||
*/
|
||||
|
||||
#include "md5.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if !defined(MBEDTLS_MD5_ALT)
|
||||
|
||||
/* Implementation that should never be optimized out by the compiler */
|
||||
static void mbedtls_zeroize(void* v, size_t n)
|
||||
{
|
||||
auto p = const_cast<volatile char*>(static_cast<char*>(v));
|
||||
while (n--)
|
||||
*p++ = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* 32-bit integer manipulation macros (little endian)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue