[Resend this email because the previous one contains a HTML subpart.
Very sorry!]

Hi Aaro,

Sorry to bother you. I saw you have added some message digest modules
to support OCTEON hardware accelerator. May I know if we can support
block ciphers
such as AES/DES ? We can get ASM primitives from
https://svn.dd-wrt.com//browser/src/linux/universal/linux-3.10/arch/mips/include/asm/octeon/cvmx-asm.h?rev=24520
Thanks.

// AES



#define CVMX_MT_AES_ENC_CBC0(val) asm volatile ("dmtc2 %[rt],0x0108" :
: [rt] "d" (val))

#define CVMX_MT_AES_ENC_CBC1(val) asm volatile ("dmtc2 %[rt],0x3109" :
: [rt] "d" (val))

#define CVMX_MT_AES_ENC0(val) asm volatile ("dmtc2 %[rt],0x010a" : :
[rt] "d" (val))

#define CVMX_MT_AES_ENC1(val) asm volatile ("dmtc2 %[rt],0x310b" : :
[rt] "d" (val))

#define CVMX_MT_AES_DEC_CBC0(val) asm volatile ("dmtc2 %[rt],0x010c" :
: [rt] "d" (val))

#define CVMX_MT_AES_DEC_CBC1(val) asm volatile ("dmtc2 %[rt],0x310d" :
: [rt] "d" (val))

#define CVMX_MT_AES_DEC0(val) asm volatile ("dmtc2 %[rt],0x010e" : :
[rt] "d" (val))

#define CVMX_MT_AES_DEC1(val) asm volatile ("dmtc2 %[rt],0x310f" : :
[rt] "d" (val))

// pos can be 0-3

#define CVMX_MT_AES_KEY(val,pos) asm volatile ("dmtc2 %[rt],0x0104+"
CVMX_TMP_STR(pos) : : [rt] "d" (val))

// pos can be 0-1

#define CVMX_MT_AES_IV(val,pos) asm volatile ("dmtc2 %[rt],0x0102+"
CVMX_TMP_STR(pos) : : [rt] "d" (val))

#define CVMX_MT_AES_KEYLENGTH(val) asm volatile ("dmtc2 %[rt],0x0110"
: : [rt] "d" (val)) // write the keylen

// pos can be 0-1

#define CVMX_MT_AES_RESULT(val,pos) asm volatile ("dmtc2
%[rt],0x0100+" CVMX_TMP_STR(pos) : : [rt] "d" (val))



// pos can be 0-1

#define CVMX_MF_AES_RESULT(val,pos) asm volatile ("dmfc2
%[rt],0x0100+" CVMX_TMP_STR(pos) : [rt] "=d" (val) : )

// pos can be 0-1

#define CVMX_MF_AES_IV(val,pos) asm volatile ("dmfc2 %[rt],0x0102+"
CVMX_TMP_STR(pos) : [rt] "=d" (val) : )

// pos can be 0-3

#define CVMX_MF_AES_KEY(val,pos) asm volatile ("dmfc2 %[rt],0x0104+"
CVMX_TMP_STR(pos) : [rt] "=d" (val) : )

#define CVMX_MF_AES_KEYLENGTH(val) asm volatile ("dmfc2 %[rt],0x0110"
: [rt] "=d" (val) : ) // read the keylen

#define CVMX_MF_AES_DAT0(val) asm volatile ("dmfc2 %[rt],0x0111" :
[rt] "=d" (val) : ) // first piece of input data

// 3DES



// pos can be 0-2

#define CVMX_MT_3DES_KEY(val,pos) asm volatile ("dmtc2 %[rt],0x0080+"
CVMX_TMP_STR(pos) : : [rt] "d" (val))

#define CVMX_MT_3DES_IV(val) asm volatile ("dmtc2 %[rt],0x0084" : :
[rt] "d" (val))

#define CVMX_MT_3DES_ENC_CBC(val) asm volatile ("dmtc2 %[rt],0x4088" :
: [rt] "d" (val))

#define CVMX_MT_3DES_ENC(val) asm volatile ("dmtc2 %[rt],0x408a" : :
[rt] "d" (val))

#define CVMX_MT_3DES_DEC_CBC(val) asm volatile ("dmtc2 %[rt],0x408c" :
: [rt] "d" (val))

#define CVMX_MT_3DES_DEC(val) asm volatile ("dmtc2 %[rt],0x408e" : :
[rt] "d" (val))

#define CVMX_MT_3DES_RESULT(val) asm volatile ("dmtc2 %[rt],0x0098" :
: [rt] "d" (val))



// pos can be 0-2

#define CVMX_MF_3DES_KEY(val,pos) asm volatile ("dmfc2 %[rt],0x0080+"
CVMX_TMP_STR(pos) : [rt] "=d" (val) : )

#define CVMX_MF_3DES_IV(val) asm volatile ("dmfc2 %[rt],0x0084" : [rt]
"=d" (val) : )

#define CVMX_MF_3DES_RESULT(val) asm volatile ("dmfc2 %[rt],0x0088" :
[rt] "=d" (val) : )


Tony

Reply via email to