add zeromem engine

anti memory leakage attack
This commit is contained in:
Zhi Guan
2017-03-16 23:20:13 +08:00
parent 3090de8951
commit 7f24b7229e
19 changed files with 3648 additions and 0 deletions

22
engines/zeromem/sys_ec2m.c Executable file
View File

@@ -0,0 +1,22 @@
#include <unistd.h>
#include "sys_ec2m.h"
int sys_ec2m_alloc(void)
{
return syscall(__NR_ec2m_alloc);
}
int sys_ec2m_free(int rid)
{
return syscall(__NR_ec2m_free, rid);
}
int sys_ec2m_setkey(int rid, mm_256* key, int a, int b)
{
return syscall(__NR_ec2m_setkey, rid, (void*)key, a, b);
}
int sys_ec2m_encrypt(int rid, mm256_point_t* bufin, mm256_point_t* bufout)
{
return syscall(__NR_ec2m_encrypt, rid, (void*)bufin, (void*)bufout);
}