Commit cce5476b authored by Naga Suramouli's avatar Naga Suramouli
Browse files

update

parent ea37ea04
/*
/*
* cryptocore_ioctl_header.h - the header file with the ioctl definitions.
* The declarations here have to be in a header file, because
* they need to be known both the kernel module in *_driver.c
......@@ -8,7 +8,8 @@
#include <linux/ioctl.h>
// CryptoCore Struct Declarations:
typedef struct MontMult_params{
typedef struct MontMult_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -18,7 +19,8 @@ typedef struct MontMult_params{
__u32 c[128];
} MontMult_params_t;
typedef struct MontR_params{
typedef struct MontR_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -26,7 +28,8 @@ typedef struct MontR_params{
__u32 r[128];
} MontR_params_t;
typedef struct MontR2_params{
typedef struct MontR2_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -34,7 +37,8 @@ typedef struct MontR2_params{
__u32 r2[128];
} MontR2_params_t;
typedef struct MontExp_params{
typedef struct MontExp_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -44,7 +48,8 @@ typedef struct MontExp_params{
__u32 c[128];
} MontExp_params_t;
typedef struct ModAdd_params{
typedef struct ModAdd_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -54,7 +59,8 @@ typedef struct ModAdd_params{
__u32 c[128];
} ModAdd_params_t;
typedef struct ModSub_params{
typedef struct ModSub_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -64,7 +70,8 @@ typedef struct ModSub_params{
__u32 c[128];
} ModSub_params_t;
typedef struct CopyH2V_params{
typedef struct CopyH2V_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -72,7 +79,8 @@ typedef struct CopyH2V_params{
__u32 acopy[128];
} CopyH2V_params_t;
typedef struct CopyV2V_params{
typedef struct CopyV2V_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -80,7 +88,8 @@ typedef struct CopyV2V_params{
__u32 acopy[128];
} CopyV2V_params_t;
typedef struct CopyH2H_params{
typedef struct CopyH2H_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -88,7 +97,8 @@ typedef struct CopyH2H_params{
__u32 acopy[128];
} CopyH2H_params_t;
typedef struct CopyV2H_params{
typedef struct CopyV2H_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -96,7 +106,8 @@ typedef struct CopyV2H_params{
__u32 acopy[128];
} CopyV2H_params_t;
typedef struct MontMult1_params{
typedef struct MontMult1_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -105,7 +116,8 @@ typedef struct MontMult1_params{
__u32 c[128];
} MontMult1_params_t;
typedef struct ModExp_params{
typedef struct ModExp_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
......@@ -115,40 +127,78 @@ typedef struct ModExp_params{
__u32 c[128];
} ModExp_params_t;
typedef struct ModRed_params{
typedef struct ModRed_params
{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
__u32 n[64];
__u32 a[128];
__u32 c[128];
} ModRed_params_t ;
} ModRed_params_t;
// Add CryptoCore Struct Declarations here...
typedef struct PointAdd_params{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
__u32 n[128];
__u32 a[128];
__u32 c[128]; //c=2 for montgomerising 2
__u32 x1[128];
__u32 y1[128];
__u32 Z1[128];
__u32 x2[128];
__u32 y2[128];
__u32 Z2[128];
__u32 XA[128];
__u32 YA[128];
__u32 ZA[128];
}PointAdd_params_t;
typedef struct PointDoub_params{
__u32 prec;
__u32 f_sel;
__u32 sec_calc;
__u32 n[128];
__u32 a[128];
__u32 p[128]; //p=2 for montgomerising 2
__u32 q[128]; //q=3 for montgomerising 3
__u32 r[128]; //r=8 for montgomerising 8
__u32 x1[128];
__u32 y1[128];
#define IOCTL_BASE 'k' // magic number
__u32 Z1[128];
__u32 XD[128];
__u32 YD[128];
__u32 ZD[128];
}PointDoub_params_t;
#define IOCTL_BASE 'k' // magic number
// NOTE: magic | cmdnumber | size of data to pass
#define IOCTL_SET_TRNG_CMD _IOW(IOCTL_BASE, 1, __u32)
#define IOCTL_SET_TRNG_CTR _IOW(IOCTL_BASE, 2, __u32)
#define IOCTL_SET_TRNG_TSTAB _IOW(IOCTL_BASE, 3, __u32)
#define IOCTL_SET_TRNG_TSAMPLE _IOW(IOCTL_BASE, 4, __u32)
#define IOCTL_READ_TRNG_FIFO _IOR(IOCTL_BASE, 5, __u32)
#define IOCTL_MWMAC_MONTMULT _IOWR(IOCTL_BASE, 6, MontMult_params_t)
#define IOCTL_MWMAC_MONTR _IOWR(IOCTL_BASE, 7, MontR_params_t)
#define IOCTL_MWMAC_MONTR2 _IOWR(IOCTL_BASE, 8, MontR2_params_t)
#define IOCTL_MWMAC_MONTEXP _IOWR(IOCTL_BASE, 9, MontExp_params_t)
#define IOCTL_MWMAC_MODADD _IOWR(IOCTL_BASE, 10, ModAdd_params_t)
#define IOCTL_MWMAC_MODSUB _IOWR(IOCTL_BASE, 11, ModSub_params_t)
#define IOCTL_MWMAC_COPYH2V _IOWR(IOCTL_BASE, 12, CopyH2V_params_t)
#define IOCTL_MWMAC_COPYV2V _IOWR(IOCTL_BASE, 13, CopyV2V_params_t)
#define IOCTL_MWMAC_COPYH2H _IOWR(IOCTL_BASE, 14, CopyH2H_params_t)
#define IOCTL_MWMAC_COPYV2H _IOWR(IOCTL_BASE, 15, CopyV2H_params_t)
#define IOCTL_MWMAC_MONTMULT1 _IOWR(IOCTL_BASE, 16, MontMult1_params_t)
#define IOCTL_MWMAC_MODEXP _IOWR(IOCTL_BASE, 17, ModExp_params_t)
#define IOCTL_MWMAC_MODRED _IOWR(IOCTL_BASE, 18, ModRed_params_t)
// Define further IOCTL commands here...
\ No newline at end of file
#define IOCTL_SET_TRNG_CMD _IOW(IOCTL_BASE, 1, __u32)
#define IOCTL_SET_TRNG_CTR _IOW(IOCTL_BASE, 2, __u32)
#define IOCTL_SET_TRNG_TSTAB _IOW(IOCTL_BASE, 3, __u32)
#define IOCTL_SET_TRNG_TSAMPLE _IOW(IOCTL_BASE, 4, __u32)
#define IOCTL_READ_TRNG_FIFO _IOR(IOCTL_BASE, 5, __u32)
#define IOCTL_MWMAC_MONTMULT _IOWR(IOCTL_BASE, 6, MontMult_params_t)
#define IOCTL_MWMAC_MONTR _IOWR(IOCTL_BASE, 7, MontR_params_t)
#define IOCTL_MWMAC_MONTR2 _IOWR(IOCTL_BASE, 8, MontR2_params_t)
#define IOCTL_MWMAC_MONTEXP _IOWR(IOCTL_BASE, 9, MontExp_params_t)
#define IOCTL_MWMAC_MODADD _IOWR(IOCTL_BASE, 10, ModAdd_params_t)
#define IOCTL_MWMAC_MODSUB _IOWR(IOCTL_BASE, 11, ModSub_params_t)
#define IOCTL_MWMAC_COPYH2V _IOWR(IOCTL_BASE, 12, CopyH2V_params_t)
#define IOCTL_MWMAC_COPYV2V _IOWR(IOCTL_BASE, 13, CopyV2V_params_t)
#define IOCTL_MWMAC_COPYH2H _IOWR(IOCTL_BASE, 14, CopyH2H_params_t)
#define IOCTL_MWMAC_COPYV2H _IOWR(IOCTL_BASE, 15, CopyV2H_params_t)
#define IOCTL_MWMAC_MONTMULT1 _IOWR(IOCTL_BASE, 16, MontMult1_params_t)
#define IOCTL_MWMAC_MODEXP _IOWR(IOCTL_BASE, 17, ModExp_params_t)
#define IOCTL_MWMAC_MODRED _IOWR(IOCTL_BASE, 18, ModRed_params_t)
// Define further IOCTL commands here...
#define IOCTL_MWMAC_PointAdd _IOWR(IOCTL_BASE, 19, PointAdd_params_t)
#define IOCTL_MWMAC_PointDoub _IOWR(IOCTL_BASE, 20, PointDoub_params_t)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment