Author Topic: Mixcolumns ordination  (Read 2204 times)

cpu2

  • Regular Member
  • *
  • Posts: 28
Mixcolumns ordination
« on: April 03, 2014, 03:41:12 PM »
Hello

I`m implementing the function Mixcolunms. I`m on the step of instructing the double word, they do it with shift bits.

I wonder if there is a better way. I cant not use pshufb. I can show what i have done.

Thanks an sorry for my expression.


Gunther

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: Mixcolumns ordination
« Reply #1 on: April 03, 2014, 07:41:52 PM »
Hi cpu2,

please show us your code and we'll see what can be done.

Gunther
Get your facts first, and then you can distort them.

dedndave

  • Member
  • *****
  • Posts: 8808
  • Still using Abacus 2.0
    • DednDave
Re: Mixcolumns ordination
« Reply #2 on: April 04, 2014, 02:39:50 AM »
this isn't exactly what you are looking for
but, it is pretty cool and might give you ideas to work with

Drizz "Stir Fry" bitswap
http://www.masmforum.com/board/index.php?topic=12722.msg98224#msg98224

cpu2

  • Regular Member
  • *
  • Posts: 28
Re: Mixcolumns ordination
« Reply #3 on: April 04, 2014, 07:26:00 AM »
Okay, i will read the link.

This is the implementation.

Code: [Select]
bts0_: .quad 0x8080808080808080,0x8080808080808080    ; 0x600218
dlb0_: .quad 0x7f7f7f7f7f7f7f7f,0x7f7f7f7f7f7f7f7f    ; 0x600228
xrb0_: .quad 0x1b1b1b1b1b1b1b1b,0x1b1b1b1b1b1b1b1b    ; 0x600238

.section .text
.globl _start

_start:

//// intel_syntax

//// xmm0 = 2 x ; xmm1 = 1 x ; xmm2 = 3 x

movdqa xmm1, xmm0
movdqa xmm2, xmm1
pand xmm0, 0x600218
pcmpeqb xmm0, 0x600218
movdqa xmm3, xmm0
pand xmm1, xmm0
pandn xmm0, xmm2
pand xmm1, 0x600228
pslld xmm0, 1
pslld xmm1, 1
pxor xmm1, 0x600238
pand xmm1, xmm3
pxor xmm0, xmm1
pxor xmm2, xmm0

Only is the ordination an XOR. As seen?

Thanks.

cpu2

  • Regular Member
  • *
  • Posts: 28
Re: Mixcolumns ordination
« Reply #4 on: April 15, 2014, 03:58:52 AM »
Already solved the problem. I use the pslld/psrld and movdqa instructions, for the ordination.

If i want the result, say.

Regards.