2019-06-04 11:11:33 +03:00
/* SPDX-License-Identifier: GPL-2.0-only */
2017-01-11 19:41:55 +03:00
/ *
* Bit s l i c e d A E S u s i n g N E O N i n s t r u c t i o n s
*
* Copyright ( C ) 2 0 1 6 L i n a r o L t d < a r d . b i e s h e u v e l @linaro.org>
* /
/ *
* The a l g o r i t h m i m p l e m e n t e d h e r e i s d e s c r i b e d i n d e t a i l b y t h e p a p e r
* ' Faster a n d T i m i n g - A t t a c k R e s i s t a n t A E S - G C M ' b y E m i l i a K a e s p e r a n d
* Peter S c h w a b e ( h t t p s : / / e p r i n t . i a c r . o r g / 2 0 0 9 / 1 2 9 . p d f )
*
* This i m p l e m e n t a t i o n i s b a s e d p r i m a r i l y o n t h e O p e n S S L i m p l e m e n t a t i o n
* for 3 2 - b i t A R M w r i t t e n b y A n d y P o l y a k o v < a p p r o @openssl.org>
* /
# include < l i n u x / l i n k a g e . h >
# include < a s m / a s s e m b l e r . h >
.text
rounds . r e q x11
bskey . r e q x12
.macro in_ b s _ c h , b0 , b1 , b2 , b3 , b4 , b5 , b6 , b7
eor \ b2 , \ b2 , \ b1
eor \ b5 , \ b5 , \ b6
eor \ b3 , \ b3 , \ b0
eor \ b6 , \ b6 , \ b2
eor \ b5 , \ b5 , \ b0
eor \ b6 , \ b6 , \ b3
eor \ b3 , \ b3 , \ b7
eor \ b7 , \ b7 , \ b5
eor \ b3 , \ b3 , \ b4
eor \ b4 , \ b4 , \ b5
eor \ b2 , \ b2 , \ b7
eor \ b3 , \ b3 , \ b1
eor \ b1 , \ b1 , \ b5
.endm
.macro out_ b s _ c h , b0 , b1 , b2 , b3 , b4 , b5 , b6 , b7
eor \ b0 , \ b0 , \ b6
eor \ b1 , \ b1 , \ b4
eor \ b4 , \ b4 , \ b6
eor \ b2 , \ b2 , \ b0
eor \ b6 , \ b6 , \ b1
eor \ b1 , \ b1 , \ b5
eor \ b5 , \ b5 , \ b3
eor \ b3 , \ b3 , \ b7
eor \ b7 , \ b7 , \ b5
eor \ b2 , \ b2 , \ b5
eor \ b4 , \ b4 , \ b7
.endm
.macro inv_ i n _ b s _ c h , b6 , b1 , b2 , b4 , b7 , b0 , b3 , b5
eor \ b1 , \ b1 , \ b7
eor \ b4 , \ b4 , \ b7
eor \ b7 , \ b7 , \ b5
eor \ b1 , \ b1 , \ b3
eor \ b2 , \ b2 , \ b5
eor \ b3 , \ b3 , \ b7
eor \ b6 , \ b6 , \ b1
eor \ b2 , \ b2 , \ b0
eor \ b5 , \ b5 , \ b3
eor \ b4 , \ b4 , \ b6
eor \ b0 , \ b0 , \ b6
eor \ b1 , \ b1 , \ b4
.endm
.macro inv_ o u t _ b s _ c h , b6 , b5 , b0 , b3 , b7 , b1 , b4 , b2
eor \ b1 , \ b1 , \ b5
eor \ b2 , \ b2 , \ b7
eor \ b3 , \ b3 , \ b1
eor \ b4 , \ b4 , \ b5
eor \ b7 , \ b7 , \ b5
eor \ b3 , \ b3 , \ b4
eor \ b5 , \ b5 , \ b0
eor \ b3 , \ b3 , \ b7
eor \ b6 , \ b6 , \ b2
eor \ b2 , \ b2 , \ b1
eor \ b6 , \ b6 , \ b3
eor \ b3 , \ b3 , \ b0
eor \ b5 , \ b5 , \ b6
.endm
.macro mul_ g f4 , x0 , x1 , y 0 , y 1 , t 0 , t 1
eor \ t 0 , \ y 0 , \ y 1
and \ t 0 , \ t 0 , \ x0
eor \ x0 , \ x0 , \ x1
and \ t 1 , \ x1 , \ y 0
and \ x0 , \ x0 , \ y 1
eor \ x1 , \ t 1 , \ t 0
eor \ x0 , \ x0 , \ t 1
.endm
.macro mul_ g f4 _ n _ g f4 , x0 , x1 , y 0 , y 1 , t 0 , x2 , x3 , y 2 , y 3 , t 1
eor \ t 0 , \ y 0 , \ y 1
eor \ t 1 , \ y 2 , \ y 3
and \ t 0 , \ t 0 , \ x0
and \ t 1 , \ t 1 , \ x2
eor \ x0 , \ x0 , \ x1
eor \ x2 , \ x2 , \ x3
and \ x1 , \ x1 , \ y 0
and \ x3 , \ x3 , \ y 2
and \ x0 , \ x0 , \ y 1
and \ x2 , \ x2 , \ y 3
eor \ x1 , \ x1 , \ x0
eor \ x2 , \ x2 , \ x3
eor \ x0 , \ x0 , \ t 0
eor \ x3 , \ x3 , \ t 1
.endm
.macro mul_ g f16 _ 2 , x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , \
y0 , y 1 , y 2 , y 3 , t 0 , t 1 , t 2 , t 3
eor \ t 0 , \ x0 , \ x2
eor \ t 1 , \ x1 , \ x3
mul_ g f4 \ x0 , \ x1 , \ y 0 , \ y 1 , \ t 2 , \ t 3
eor \ y 0 , \ y 0 , \ y 2
eor \ y 1 , \ y 1 , \ y 3
mul_ g f4 _ n _ g f4 \ t 0 , \ t 1 , \ y 0 , \ y 1 , \ t 3 , \ x2 , \ x3 , \ y 2 , \ y 3 , \ t 2
eor \ x0 , \ x0 , \ t 0
eor \ x2 , \ x2 , \ t 0
eor \ x1 , \ x1 , \ t 1
eor \ x3 , \ x3 , \ t 1
eor \ t 0 , \ x4 , \ x6
eor \ t 1 , \ x5 , \ x7
mul_ g f4 _ n _ g f4 \ t 0 , \ t 1 , \ y 0 , \ y 1 , \ t 3 , \ x6 , \ x7 , \ y 2 , \ y 3 , \ t 2
eor \ y 0 , \ y 0 , \ y 2
eor \ y 1 , \ y 1 , \ y 3
mul_ g f4 \ x4 , \ x5 , \ y 0 , \ y 1 , \ t 2 , \ t 3
eor \ x4 , \ x4 , \ t 0
eor \ x6 , \ x6 , \ t 0
eor \ x5 , \ x5 , \ t 1
eor \ x7 , \ x7 , \ t 1
.endm
.macro inv_ g f25 6 , x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , \
t0 , t 1 , t 2 , t 3 , s0 , s1 , s2 , s3
eor \ t 3 , \ x4 , \ x6
eor \ t 0 , \ x5 , \ x7
eor \ t 1 , \ x1 , \ x3
eor \ s1 , \ x7 , \ x6
eor \ s0 , \ x0 , \ x2
eor \ s3 , \ t 3 , \ t 0
orr \ t 2 , \ t 0 , \ t 1
and \ s2 , \ t 3 , \ s0
orr \ t 3 , \ t 3 , \ s0
eor \ s0 , \ s0 , \ t 1
and \ t 0 , \ t 0 , \ t 1
eor \ t 1 , \ x3 , \ x2
and \ s3 , \ s3 , \ s0
and \ s1 , \ s1 , \ t 1
eor \ t 1 , \ x4 , \ x5
eor \ s0 , \ x1 , \ x0
eor \ t 3 , \ t 3 , \ s1
eor \ t 2 , \ t 2 , \ s1
and \ s1 , \ t 1 , \ s0
orr \ t 1 , \ t 1 , \ s0
eor \ t 3 , \ t 3 , \ s3
eor \ t 0 , \ t 0 , \ s1
eor \ t 2 , \ t 2 , \ s2
eor \ t 1 , \ t 1 , \ s3
eor \ t 0 , \ t 0 , \ s2
and \ s0 , \ x7 , \ x3
eor \ t 1 , \ t 1 , \ s2
and \ s1 , \ x6 , \ x2
and \ s2 , \ x5 , \ x1
orr \ s3 , \ x4 , \ x0
eor \ t 3 , \ t 3 , \ s0
eor \ t 1 , \ t 1 , \ s2
eor \ s0 , \ t 0 , \ s3
eor \ t 2 , \ t 2 , \ s1
and \ s2 , \ t 3 , \ t 1
eor \ s1 , \ t 2 , \ s2
eor \ s3 , \ s0 , \ s2
bsl \ s1 , \ t 1 , \ s0
not \ t 0 , \ s0
bsl \ s0 , \ s1 , \ s3
bsl \ t 0 , \ s1 , \ s3
bsl \ s3 , \ t 3 , \ t 2
eor \ t 3 , \ t 3 , \ t 2
and \ s2 , \ s0 , \ s3
eor \ t 1 , \ t 1 , \ t 0
eor \ s2 , \ s2 , \ t 3
mul_ g f16 _ 2 \ x0 , \ x1 , \ x2 , \ x3 , \ x4 , \ x5 , \ x6 , \ x7 , \
\ s3 , \ s2 , \ s1 , \ t 1 , \ s0 , \ t 0 , \ t 2 , \ t 3
.endm
.macro sbox, b0 , b1 , b2 , b3 , b4 , b5 , b6 , b7 , \
t0 , t 1 , t 2 , t 3 , s0 , s1 , s2 , s3
in_ b s _ c h \ b0 \ ( ) . 1 6 b , \ b1 \ ( ) . 1 6 b , \ b2 \ ( ) . 1 6 b , \ b3 \ ( ) . 1 6 b , \
\ b4 \ ( ) . 1 6 b , \ b5 \ ( ) . 1 6 b , \ b6 \ ( ) . 1 6 b , \ b7 \ ( ) . 1 6 b
inv_ g f25 6 \ b6 \ ( ) . 1 6 b , \ b5 \ ( ) . 1 6 b , \ b0 \ ( ) . 1 6 b , \ b3 \ ( ) . 1 6 b , \
\ b7 \ ( ) . 1 6 b , \ b1 \ ( ) . 1 6 b , \ b4 \ ( ) . 1 6 b , \ b2 \ ( ) . 1 6 b , \
\ t0 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b , \ t 2 \ ( ) . 1 6 b , \ t 3 \ ( ) . 1 6 b , \
\ s0 \ ( ) . 1 6 b , \ s1 \ ( ) . 1 6 b , \ s2 \ ( ) . 1 6 b , \ s3 \ ( ) . 1 6 b
out_ b s _ c h \ b7 \ ( ) . 1 6 b , \ b1 \ ( ) . 1 6 b , \ b4 \ ( ) . 1 6 b , \ b2 \ ( ) . 1 6 b , \
\ b6 \ ( ) . 1 6 b , \ b5 \ ( ) . 1 6 b , \ b0 \ ( ) . 1 6 b , \ b3 \ ( ) . 1 6 b
.endm
.macro inv_ s b o x , b0 , b1 , b2 , b3 , b4 , b5 , b6 , b7 , \
t0 , t 1 , t 2 , t 3 , s0 , s1 , s2 , s3
inv_ i n _ b s _ c h \ b0 \ ( ) . 1 6 b , \ b1 \ ( ) . 1 6 b , \ b2 \ ( ) . 1 6 b , \ b3 \ ( ) . 1 6 b , \
\ b4 \ ( ) . 1 6 b , \ b5 \ ( ) . 1 6 b , \ b6 \ ( ) . 1 6 b , \ b7 \ ( ) . 1 6 b
inv_ g f25 6 \ b5 \ ( ) . 1 6 b , \ b1 \ ( ) . 1 6 b , \ b2 \ ( ) . 1 6 b , \ b6 \ ( ) . 1 6 b , \
\ b3 \ ( ) . 1 6 b , \ b7 \ ( ) . 1 6 b , \ b0 \ ( ) . 1 6 b , \ b4 \ ( ) . 1 6 b , \
\ t0 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b , \ t 2 \ ( ) . 1 6 b , \ t 3 \ ( ) . 1 6 b , \
\ s0 \ ( ) . 1 6 b , \ s1 \ ( ) . 1 6 b , \ s2 \ ( ) . 1 6 b , \ s3 \ ( ) . 1 6 b
inv_ o u t _ b s _ c h \ b3 \ ( ) . 1 6 b , \ b7 \ ( ) . 1 6 b , \ b0 \ ( ) . 1 6 b , \ b4 \ ( ) . 1 6 b , \
\ b5 \ ( ) . 1 6 b , \ b1 \ ( ) . 1 6 b , \ b2 \ ( ) . 1 6 b , \ b6 \ ( ) . 1 6 b
.endm
.macro enc_next_rk
ldp q16 , q17 , [ b s k e y ] , #128
ldp q18 , q19 , [ b s k e y , #- 96 ]
ldp q20 , q21 , [ b s k e y , #- 64 ]
ldp q22 , q23 , [ b s k e y , #- 32 ]
.endm
.macro dec_next_rk
ldp q16 , q17 , [ b s k e y , #- 128 ] !
ldp q18 , q19 , [ b s k e y , #32 ]
ldp q20 , q21 , [ b s k e y , #64 ]
ldp q22 , q23 , [ b s k e y , #96 ]
.endm
.macro add_ r o u n d _ k e y , x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7
eor \ x0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b , v16 . 1 6 b
eor \ x1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , v17 . 1 6 b
eor \ x2 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b , v18 . 1 6 b
eor \ x3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , v19 . 1 6 b
eor \ x4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , v20 . 1 6 b
eor \ x5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , v21 . 1 6 b
eor \ x6 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , v22 . 1 6 b
eor \ x7 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b , v23 . 1 6 b
.endm
.macro shift_ r o w s , x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , m a s k
tbl \ x0 \ ( ) . 1 6 b , { \ x0 \ ( ) . 1 6 b } , \ m a s k \ ( ) . 1 6 b
tbl \ x1 \ ( ) . 1 6 b , { \ x1 \ ( ) . 1 6 b } , \ m a s k \ ( ) . 1 6 b
tbl \ x2 \ ( ) . 1 6 b , { \ x2 \ ( ) . 1 6 b } , \ m a s k \ ( ) . 1 6 b
tbl \ x3 \ ( ) . 1 6 b , { \ x3 \ ( ) . 1 6 b } , \ m a s k \ ( ) . 1 6 b
tbl \ x4 \ ( ) . 1 6 b , { \ x4 \ ( ) . 1 6 b } , \ m a s k \ ( ) . 1 6 b
tbl \ x5 \ ( ) . 1 6 b , { \ x5 \ ( ) . 1 6 b } , \ m a s k \ ( ) . 1 6 b
tbl \ x6 \ ( ) . 1 6 b , { \ x6 \ ( ) . 1 6 b } , \ m a s k \ ( ) . 1 6 b
tbl \ x7 \ ( ) . 1 6 b , { \ x7 \ ( ) . 1 6 b } , \ m a s k \ ( ) . 1 6 b
.endm
.macro mix_ c o l s , x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , \
t0 , t 1 , t 2 , t 3 , t 4 , t 5 , t 6 , t 7 , i n v
ext \ t 0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b , #12
ext \ t 1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , #12
eor \ x0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b
ext \ t 2 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b , #12
eor \ x1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b
ext \ t 3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , #12
eor \ x2 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b , \ t 2 \ ( ) . 1 6 b
ext \ t 4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , #12
eor \ x3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , \ t 3 \ ( ) . 1 6 b
ext \ t 5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , #12
eor \ x4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , \ t 4 \ ( ) . 1 6 b
ext \ t 6 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , #12
eor \ x5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , \ t 5 \ ( ) . 1 6 b
ext \ t 7 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b , #12
eor \ x6 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , \ t 6 \ ( ) . 1 6 b
eor \ t 1 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b
eor \ x7 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b , \ t 7 \ ( ) . 1 6 b
ext \ x0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b , #8
eor \ t 2 \ ( ) . 1 6 b , \ t 2 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b
eor \ t 0 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b
eor \ t 1 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b
ext \ x1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , #8
eor \ t 5 \ ( ) . 1 6 b , \ t 5 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b
eor \ x0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b
eor \ t 6 \ ( ) . 1 6 b , \ t 6 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b
eor \ x1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b
ext \ t 0 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , #8
eor \ t 4 \ ( ) . 1 6 b , \ t 4 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b
ext \ t 1 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , #8
eor \ t 7 \ ( ) . 1 6 b , \ t 7 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b
ext \ x4 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , #8
eor \ t 3 \ ( ) . 1 6 b , \ t 3 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b
ext \ x5 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b , #8
eor \ t 4 \ ( ) . 1 6 b , \ t 4 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b
ext \ x3 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , #8
eor \ t 3 \ ( ) . 1 6 b , \ t 3 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b
ext \ x6 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b , #8
eor \ x7 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b , \ t 5 \ ( ) . 1 6 b
.ifb \ inv
eor \ x2 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b , \ t 4 \ ( ) . 1 6 b
eor \ x4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , \ t 3 \ ( ) . 1 6 b
eor \ x5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , \ t 7 \ ( ) . 1 6 b
eor \ x3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , \ t 6 \ ( ) . 1 6 b
eor \ x6 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , \ t 2 \ ( ) . 1 6 b
.else
eor \ t 3 \ ( ) . 1 6 b , \ t 3 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b
eor \ x5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , \ t 7 \ ( ) . 1 6 b
eor \ x2 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , \ t 6 \ ( ) . 1 6 b
eor \ x3 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b , \ t 4 \ ( ) . 1 6 b
eor \ x4 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , \ t 2 \ ( ) . 1 6 b
mov \ x6 \ ( ) . 1 6 b , \ t 3 \ ( ) . 1 6 b
.endif
.endm
.macro inv_ m i x _ c o l s , x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , \
t0 , t 1 , t 2 , t 3 , t 4 , t 5 , t 6 , t 7
ext \ t 0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b , #8
ext \ t 6 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , #8
ext \ t 7 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b , #8
eor \ t 0 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b
ext \ t 1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , #8
eor \ t 6 \ ( ) . 1 6 b , \ t 6 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b
ext \ t 2 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b , #8
eor \ t 7 \ ( ) . 1 6 b , \ t 7 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b
ext \ t 3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , #8
eor \ t 1 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b
ext \ t 4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , #8
eor \ t 2 \ ( ) . 1 6 b , \ t 2 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b
ext \ t 5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , #8
eor \ t 3 \ ( ) . 1 6 b , \ t 3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b
eor \ t 4 \ ( ) . 1 6 b , \ t 4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b
eor \ t 5 \ ( ) . 1 6 b , \ t 5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b
eor \ x0 \ ( ) . 1 6 b , \ x0 \ ( ) . 1 6 b , \ t 6 \ ( ) . 1 6 b
eor \ x1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , \ t 6 \ ( ) . 1 6 b
eor \ x2 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b
eor \ x4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , \ t 2 \ ( ) . 1 6 b
eor \ x3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b
eor \ x1 \ ( ) . 1 6 b , \ x1 \ ( ) . 1 6 b , \ t 7 \ ( ) . 1 6 b
eor \ x2 \ ( ) . 1 6 b , \ x2 \ ( ) . 1 6 b , \ t 7 \ ( ) . 1 6 b
eor \ x4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , \ t 6 \ ( ) . 1 6 b
eor \ x5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , \ t 3 \ ( ) . 1 6 b
eor \ x3 \ ( ) . 1 6 b , \ x3 \ ( ) . 1 6 b , \ t 6 \ ( ) . 1 6 b
eor \ x6 \ ( ) . 1 6 b , \ x6 \ ( ) . 1 6 b , \ t 4 \ ( ) . 1 6 b
eor \ x4 \ ( ) . 1 6 b , \ x4 \ ( ) . 1 6 b , \ t 7 \ ( ) . 1 6 b
eor \ x5 \ ( ) . 1 6 b , \ x5 \ ( ) . 1 6 b , \ t 7 \ ( ) . 1 6 b
eor \ x7 \ ( ) . 1 6 b , \ x7 \ ( ) . 1 6 b , \ t 5 \ ( ) . 1 6 b
mix_ c o l s \ x0 , \ x1 , \ x2 , \ x3 , \ x4 , \ x5 , \ x6 , \ x7 , \
\ t0 , \ t 1 , \ t 2 , \ t 3 , \ t 4 , \ t 5 , \ t 6 , \ t 7 , 1
.endm
.macro swapmove_ 2 x , a0 , b0 , a1 , b1 , n , m a s k , t 0 , t 1
ushr \ t 0 \ ( ) . 2 d , \ b0 \ ( ) . 2 d , #\ n
ushr \ t 1 \ ( ) . 2 d , \ b1 \ ( ) . 2 d , #\ n
eor \ t 0 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b , \ a0 \ ( ) . 1 6 b
eor \ t 1 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b , \ a1 \ ( ) . 1 6 b
and \ t 0 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b , \ m a s k \ ( ) . 1 6 b
and \ t 1 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b , \ m a s k \ ( ) . 1 6 b
eor \ a0 \ ( ) . 1 6 b , \ a0 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b
shl \ t 0 \ ( ) . 2 d , \ t 0 \ ( ) . 2 d , #\ n
eor \ a1 \ ( ) . 1 6 b , \ a1 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b
shl \ t 1 \ ( ) . 2 d , \ t 1 \ ( ) . 2 d , #\ n
eor \ b0 \ ( ) . 1 6 b , \ b0 \ ( ) . 1 6 b , \ t 0 \ ( ) . 1 6 b
eor \ b1 \ ( ) . 1 6 b , \ b1 \ ( ) . 1 6 b , \ t 1 \ ( ) . 1 6 b
.endm
.macro bitslice, x7 , x6 , x5 , x4 , x3 , x2 , x1 , x0 , t 0 , t 1 , t 2 , t 3
movi \ t 0 \ ( ) . 1 6 b , #0x55
movi \ t 1 \ ( ) . 1 6 b , #0x33
swapmove_ 2 x \ x0 , \ x1 , \ x2 , \ x3 , 1 , \ t 0 , \ t 2 , \ t 3
swapmove_ 2 x \ x4 , \ x5 , \ x6 , \ x7 , 1 , \ t 0 , \ t 2 , \ t 3
movi \ t 0 \ ( ) . 1 6 b , #0x0f
swapmove_ 2 x \ x0 , \ x2 , \ x1 , \ x3 , 2 , \ t 1 , \ t 2 , \ t 3
swapmove_ 2 x \ x4 , \ x6 , \ x5 , \ x7 , 2 , \ t 1 , \ t 2 , \ t 3
swapmove_ 2 x \ x0 , \ x4 , \ x1 , \ x5 , 4 , \ t 0 , \ t 2 , \ t 3
swapmove_ 2 x \ x2 , \ x6 , \ x3 , \ x7 , 4 , \ t 0 , \ t 2 , \ t 3
.endm
.align 6
M0 : .octa 0x0004080c 0 1 0 5 0 9 0 d0 2 0 6 0 a0 e 0 3 0 7 0 b0 f
M0SR : .octa 0x0004080c 0 5 0 9 0 d0 1 0 a0 e 0 2 0 6 0 f03 0 7 0 b
SR : .octa 0x0f0e0d0c 0 a0 9 0 8 0 b05 0 4 0 7 0 6 0 0 0 3 0 2 0 1
SRM0 : .octa 0x01060b0c 0 2 0 7 0 8 0 d0 3 0 4 0 9 0 e 0 0 0 5 0 a0 f
M0ISR : .octa 0x0004080c 0 d0 1 0 5 0 9 0 a0 e 0 2 0 6 0 7 0 b0 f03
ISR : .octa 0x0f0e0d0c 0 8 0 b0 a09 0 5 0 4 0 7 0 6 0 2 0 1 0 0 0 3
ISRM0 : .octa 0x0306090c 0 0 0 7 0 a0 d01 0 4 0 b0 e 0 2 0 5 0 8 0 f
/ *
* void a e s b s _ c o n v e r t _ k e y ( u 8 o u t [ ] , u 3 2 c o n s t r k [ ] , i n t r o u n d s )
* /
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ S T A R T ( a e s b s _ c o n v e r t _ k e y )
2017-01-11 19:41:55 +03:00
ld1 { v7 . 4 s } , [ x1 ] , #16 / / l o a d r o u n d 0 k e y
ld1 { v17 . 4 s } , [ x1 ] , #16 / / l o a d r o u n d 1 k e y
movi v8 . 1 6 b , #0x01 / / b i t m a s k s
movi v9 . 1 6 b , #0x02
movi v10 . 1 6 b , #0x04
movi v11 . 1 6 b , #0x08
movi v12 . 1 6 b , #0x10
movi v13 . 1 6 b , #0x20
movi v14 . 1 6 b , #0x40
movi v15 . 1 6 b , #0x80
ldr q16 , M 0
sub x2 , x2 , #1
str q7 , [ x0 ] , #16 / / s a v e r o u n d 0 k e y
.Lkey_loop :
tbl v7 . 1 6 b ,{ v17 . 1 6 b } , v16 . 1 6 b
ld1 { v17 . 4 s } , [ x1 ] , #16 / / l o a d n e x t r o u n d k e y
cmtst v0 . 1 6 b , v7 . 1 6 b , v8 . 1 6 b
cmtst v1 . 1 6 b , v7 . 1 6 b , v9 . 1 6 b
cmtst v2 . 1 6 b , v7 . 1 6 b , v10 . 1 6 b
cmtst v3 . 1 6 b , v7 . 1 6 b , v11 . 1 6 b
cmtst v4 . 1 6 b , v7 . 1 6 b , v12 . 1 6 b
cmtst v5 . 1 6 b , v7 . 1 6 b , v13 . 1 6 b
cmtst v6 . 1 6 b , v7 . 1 6 b , v14 . 1 6 b
cmtst v7 . 1 6 b , v7 . 1 6 b , v15 . 1 6 b
not v0 . 1 6 b , v0 . 1 6 b
not v1 . 1 6 b , v1 . 1 6 b
not v5 . 1 6 b , v5 . 1 6 b
not v6 . 1 6 b , v6 . 1 6 b
subs x2 , x2 , #1
stp q0 , q1 , [ x0 ] , #128
stp q2 , q3 , [ x0 , #- 96 ]
stp q4 , q5 , [ x0 , #- 64 ]
stp q6 , q7 , [ x0 , #- 32 ]
b. n e . L k e y _ l o o p
movi v7 . 1 6 b , #0x63 / / c o m p o s e . L 6 3
eor v17 . 1 6 b , v17 . 1 6 b , v7 . 1 6 b
str q17 , [ x0 ]
ret
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ E N D ( a e s b s _ c o n v e r t _ k e y )
2017-01-11 19:41:55 +03:00
.align 4
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ S T A R T _ L O C A L ( a e s b s _ e n c r y p t 8 )
2017-01-11 19:41:55 +03:00
ldr q9 , [ b s k e y ] , #16 / / r o u n d 0 k e y
ldr q8 , M 0 S R
ldr q24 , S R
eor v10 . 1 6 b , v0 . 1 6 b , v9 . 1 6 b / / x o r w i t h r o u n d0 k e y
eor v11 . 1 6 b , v1 . 1 6 b , v9 . 1 6 b
tbl v0 . 1 6 b , { v10 . 1 6 b } , v8 . 1 6 b
eor v12 . 1 6 b , v2 . 1 6 b , v9 . 1 6 b
tbl v1 . 1 6 b , { v11 . 1 6 b } , v8 . 1 6 b
eor v13 . 1 6 b , v3 . 1 6 b , v9 . 1 6 b
tbl v2 . 1 6 b , { v12 . 1 6 b } , v8 . 1 6 b
eor v14 . 1 6 b , v4 . 1 6 b , v9 . 1 6 b
tbl v3 . 1 6 b , { v13 . 1 6 b } , v8 . 1 6 b
eor v15 . 1 6 b , v5 . 1 6 b , v9 . 1 6 b
tbl v4 . 1 6 b , { v14 . 1 6 b } , v8 . 1 6 b
eor v10 . 1 6 b , v6 . 1 6 b , v9 . 1 6 b
tbl v5 . 1 6 b , { v15 . 1 6 b } , v8 . 1 6 b
eor v11 . 1 6 b , v7 . 1 6 b , v9 . 1 6 b
tbl v6 . 1 6 b , { v10 . 1 6 b } , v8 . 1 6 b
tbl v7 . 1 6 b , { v11 . 1 6 b } , v8 . 1 6 b
bitslice v0 , v1 , v2 , v3 , v4 , v5 , v6 , v7 , v8 , v9 , v10 , v11
sub r o u n d s , r o u n d s , #1
b . L e n c _ s b o x
.Lenc_loop :
shift_ r o w s v0 , v1 , v2 , v3 , v4 , v5 , v6 , v7 , v24
.Lenc_sbox :
sbox v0 , v1 , v2 , v3 , v4 , v5 , v6 , v7 , v8 , v9 , v10 , v11 , v12 , \
v1 3 , v14 , v15
subs r o u n d s , r o u n d s , #1
b. c c . L e n c _ d o n e
enc_ n e x t _ r k
mix_ c o l s v0 , v1 , v4 , v6 , v3 , v7 , v2 , v5 , v8 , v9 , v10 , v11 , v12 , \
v1 3 , v14 , v15
add_ r o u n d _ k e y v0 , v1 , v2 , v3 , v4 , v5 , v6 , v7
b. n e . L e n c _ l o o p
ldr q24 , S R M 0
b . L e n c _ l o o p
.Lenc_done :
ldr q12 , [ b s k e y ] / / l a s t r o u n d k e y
bitslice v0 , v1 , v4 , v6 , v3 , v7 , v2 , v5 , v8 , v9 , v10 , v11
eor v0 . 1 6 b , v0 . 1 6 b , v12 . 1 6 b
eor v1 . 1 6 b , v1 . 1 6 b , v12 . 1 6 b
eor v4 . 1 6 b , v4 . 1 6 b , v12 . 1 6 b
eor v6 . 1 6 b , v6 . 1 6 b , v12 . 1 6 b
eor v3 . 1 6 b , v3 . 1 6 b , v12 . 1 6 b
eor v7 . 1 6 b , v7 . 1 6 b , v12 . 1 6 b
eor v2 . 1 6 b , v2 . 1 6 b , v12 . 1 6 b
eor v5 . 1 6 b , v5 . 1 6 b , v12 . 1 6 b
ret
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ E N D ( a e s b s _ e n c r y p t 8 )
2017-01-11 19:41:55 +03:00
.align 4
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ S T A R T _ L O C A L ( a e s b s _ d e c r y p t 8 )
2017-01-11 19:41:55 +03:00
lsl x9 , r o u n d s , #7
add b s k e y , b s k e y , x9
ldr q9 , [ b s k e y , #- 112 ] ! / / r o u n d 0 k e y
ldr q8 , M 0 I S R
ldr q24 , I S R
eor v10 . 1 6 b , v0 . 1 6 b , v9 . 1 6 b / / x o r w i t h r o u n d0 k e y
eor v11 . 1 6 b , v1 . 1 6 b , v9 . 1 6 b
tbl v0 . 1 6 b , { v10 . 1 6 b } , v8 . 1 6 b
eor v12 . 1 6 b , v2 . 1 6 b , v9 . 1 6 b
tbl v1 . 1 6 b , { v11 . 1 6 b } , v8 . 1 6 b
eor v13 . 1 6 b , v3 . 1 6 b , v9 . 1 6 b
tbl v2 . 1 6 b , { v12 . 1 6 b } , v8 . 1 6 b
eor v14 . 1 6 b , v4 . 1 6 b , v9 . 1 6 b
tbl v3 . 1 6 b , { v13 . 1 6 b } , v8 . 1 6 b
eor v15 . 1 6 b , v5 . 1 6 b , v9 . 1 6 b
tbl v4 . 1 6 b , { v14 . 1 6 b } , v8 . 1 6 b
eor v10 . 1 6 b , v6 . 1 6 b , v9 . 1 6 b
tbl v5 . 1 6 b , { v15 . 1 6 b } , v8 . 1 6 b
eor v11 . 1 6 b , v7 . 1 6 b , v9 . 1 6 b
tbl v6 . 1 6 b , { v10 . 1 6 b } , v8 . 1 6 b
tbl v7 . 1 6 b , { v11 . 1 6 b } , v8 . 1 6 b
bitslice v0 , v1 , v2 , v3 , v4 , v5 , v6 , v7 , v8 , v9 , v10 , v11
sub r o u n d s , r o u n d s , #1
b . L d e c _ s b o x
.Ldec_loop :
shift_ r o w s v0 , v1 , v2 , v3 , v4 , v5 , v6 , v7 , v24
.Ldec_sbox :
inv_ s b o x v0 , v1 , v2 , v3 , v4 , v5 , v6 , v7 , v8 , v9 , v10 , v11 , v12 , \
v1 3 , v14 , v15
subs r o u n d s , r o u n d s , #1
b. c c . L d e c _ d o n e
dec_ n e x t _ r k
add_ r o u n d _ k e y v0 , v1 , v6 , v4 , v2 , v7 , v3 , v5
inv_ m i x _ c o l s v0 , v1 , v6 , v4 , v2 , v7 , v3 , v5 , v8 , v9 , v10 , v11 , v12 , \
v1 3 , v14 , v15
b. n e . L d e c _ l o o p
ldr q24 , I S R M 0
b . L d e c _ l o o p
.Ldec_done :
ldr q12 , [ b s k e y , #- 16 ] / / l a s t r o u n d k e y
bitslice v0 , v1 , v6 , v4 , v2 , v7 , v3 , v5 , v8 , v9 , v10 , v11
eor v0 . 1 6 b , v0 . 1 6 b , v12 . 1 6 b
eor v1 . 1 6 b , v1 . 1 6 b , v12 . 1 6 b
eor v6 . 1 6 b , v6 . 1 6 b , v12 . 1 6 b
eor v4 . 1 6 b , v4 . 1 6 b , v12 . 1 6 b
eor v2 . 1 6 b , v2 . 1 6 b , v12 . 1 6 b
eor v7 . 1 6 b , v7 . 1 6 b , v12 . 1 6 b
eor v3 . 1 6 b , v3 . 1 6 b , v12 . 1 6 b
eor v5 . 1 6 b , v5 . 1 6 b , v12 . 1 6 b
ret
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ E N D ( a e s b s _ d e c r y p t 8 )
2017-01-11 19:41:55 +03:00
/ *
* aesbs_ e c b _ e n c r y p t ( u 8 o u t [ ] , u 8 c o n s t i n [ ] , u 8 c o n s t r k [ ] , i n t r o u n d s ,
* int b l o c k s )
* aesbs_ e c b _ d e c r y p t ( u 8 o u t [ ] , u 8 c o n s t i n [ ] , u 8 c o n s t r k [ ] , i n t r o u n d s ,
* int b l o c k s )
* /
.macro _ _ ecb_ c r y p t , d o 8 , o 0 , o 1 , o 2 , o 3 , o 4 , o 5 , o 6 , o 7
2018-04-30 19:18:25 +03:00
frame_ p u s h 5
mov x19 , x0
mov x20 , x1
mov x21 , x2
mov x22 , x3
mov x23 , x4
2017-01-11 19:41:55 +03:00
99 : mov x5 , #1
2018-04-30 19:18:25 +03:00
lsl x5 , x5 , x23
subs w23 , w23 , #8
csel x23 , x23 , x z r , p l
2017-01-11 19:41:55 +03:00
csel x5 , x5 , x z r , m i
2018-04-30 19:18:25 +03:00
ld1 { v0 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #1 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v1 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #2 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v2 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #3 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v3 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #4 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v4 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #5 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v5 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #6 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v6 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #7 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v7 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
2018-04-30 19:18:25 +03:00
0 : mov b s k e y , x21
mov r o u n d s , x22
2017-01-11 19:41:55 +03:00
bl \ d o 8
2018-04-30 19:18:25 +03:00
st1 { \ o 0 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #1 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 1 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #2 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 2 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #3 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 3 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #4 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 4 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #5 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 5 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #6 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 6 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x5 , #7 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 7 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
2018-04-30 19:18:25 +03:00
cbz x23 , 1 f
b 9 9 b
2017-01-11 19:41:55 +03:00
2018-04-30 19:18:25 +03:00
1 : frame_ p o p
2017-01-11 19:41:55 +03:00
ret
.endm
.align 4
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ S T A R T ( a e s b s _ e c b _ e n c r y p t )
2017-01-11 19:41:55 +03:00
_ _ ecb_ c r y p t a e s b s _ e n c r y p t 8 , v0 , v1 , v4 , v6 , v3 , v7 , v2 , v5
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ E N D ( a e s b s _ e c b _ e n c r y p t )
2017-01-11 19:41:55 +03:00
.align 4
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ S T A R T ( a e s b s _ e c b _ d e c r y p t )
2017-01-11 19:41:55 +03:00
_ _ ecb_ c r y p t a e s b s _ d e c r y p t 8 , v0 , v1 , v6 , v4 , v2 , v7 , v3 , v5
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ E N D ( a e s b s _ e c b _ d e c r y p t )
2017-01-11 19:41:55 +03:00
/ *
* aesbs_ c b c _ d e c r y p t ( u 8 o u t [ ] , u 8 c o n s t i n [ ] , u 8 c o n s t r k [ ] , i n t r o u n d s ,
* int b l o c k s , u 8 i v [ ] )
* /
.align 4
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ S T A R T ( a e s b s _ c b c _ d e c r y p t )
2018-04-30 19:18:25 +03:00
frame_ p u s h 6
mov x19 , x0
mov x20 , x1
mov x21 , x2
mov x22 , x3
mov x23 , x4
mov x24 , x5
2017-01-11 19:41:55 +03:00
99 : mov x6 , #1
2018-04-30 19:18:25 +03:00
lsl x6 , x6 , x23
subs w23 , w23 , #8
csel x23 , x23 , x z r , p l
2017-01-11 19:41:55 +03:00
csel x6 , x6 , x z r , m i
2018-04-30 19:18:25 +03:00
ld1 { v0 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
mov v25 . 1 6 b , v0 . 1 6 b
tbnz x6 , #1 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v1 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
mov v26 . 1 6 b , v1 . 1 6 b
tbnz x6 , #2 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v2 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
mov v27 . 1 6 b , v2 . 1 6 b
tbnz x6 , #3 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v3 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
mov v28 . 1 6 b , v3 . 1 6 b
tbnz x6 , #4 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v4 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
mov v29 . 1 6 b , v4 . 1 6 b
tbnz x6 , #5 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v5 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
mov v30 . 1 6 b , v5 . 1 6 b
tbnz x6 , #6 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v6 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
mov v31 . 1 6 b , v6 . 1 6 b
tbnz x6 , #7 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v7 . 1 6 b } , [ x20 ]
2017-01-11 19:41:55 +03:00
2018-04-30 19:18:25 +03:00
0 : mov b s k e y , x21
mov r o u n d s , x22
2017-01-11 19:41:55 +03:00
bl a e s b s _ d e c r y p t 8
2018-04-30 19:18:25 +03:00
ld1 { v24 . 1 6 b } , [ x24 ] / / l o a d I V
2017-01-11 19:41:55 +03:00
eor v1 . 1 6 b , v1 . 1 6 b , v25 . 1 6 b
eor v6 . 1 6 b , v6 . 1 6 b , v26 . 1 6 b
eor v4 . 1 6 b , v4 . 1 6 b , v27 . 1 6 b
eor v2 . 1 6 b , v2 . 1 6 b , v28 . 1 6 b
eor v7 . 1 6 b , v7 . 1 6 b , v29 . 1 6 b
eor v0 . 1 6 b , v0 . 1 6 b , v24 . 1 6 b
eor v3 . 1 6 b , v3 . 1 6 b , v30 . 1 6 b
eor v5 . 1 6 b , v5 . 1 6 b , v31 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { v0 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v24 . 1 6 b , v25 . 1 6 b
tbnz x6 , #1 , 1 f
2018-04-30 19:18:25 +03:00
st1 { v1 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v24 . 1 6 b , v26 . 1 6 b
tbnz x6 , #2 , 1 f
2018-04-30 19:18:25 +03:00
st1 { v6 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v24 . 1 6 b , v27 . 1 6 b
tbnz x6 , #3 , 1 f
2018-04-30 19:18:25 +03:00
st1 { v4 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v24 . 1 6 b , v28 . 1 6 b
tbnz x6 , #4 , 1 f
2018-04-30 19:18:25 +03:00
st1 { v2 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v24 . 1 6 b , v29 . 1 6 b
tbnz x6 , #5 , 1 f
2018-04-30 19:18:25 +03:00
st1 { v7 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v24 . 1 6 b , v30 . 1 6 b
tbnz x6 , #6 , 1 f
2018-04-30 19:18:25 +03:00
st1 { v3 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v24 . 1 6 b , v31 . 1 6 b
tbnz x6 , #7 , 1 f
2018-04-30 19:18:25 +03:00
ld1 { v24 . 1 6 b } , [ x20 ] , #16
st1 { v5 . 1 6 b } , [ x19 ] , #16
1 : st1 { v24 . 1 6 b } , [ x24 ] / / s t o r e I V
2017-01-11 19:41:55 +03:00
2018-04-30 19:18:25 +03:00
cbz x23 , 2 f
b 9 9 b
2017-01-11 19:41:55 +03:00
2018-04-30 19:18:25 +03:00
2 : frame_ p o p
2017-01-11 19:41:55 +03:00
ret
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ E N D ( a e s b s _ c b c _ d e c r y p t )
2017-01-11 19:41:55 +03:00
.macro next_ t w e a k , o u t , i n , c o n s t , t m p
sshr \ t m p \ ( ) . 2 d , \ i n \ ( ) . 2 d , #63
and \ t m p \ ( ) . 1 6 b , \ t m p \ ( ) . 1 6 b , \ c o n s t \ ( ) . 1 6 b
add \ o u t \ ( ) . 2 d , \ i n \ ( ) . 2 d , \ i n \ ( ) . 2 d
ext \ t m p \ ( ) . 1 6 b , \ t m p \ ( ) . 1 6 b , \ t m p \ ( ) . 1 6 b , #8
eor \ o u t \ ( ) . 1 6 b , \ o u t \ ( ) . 1 6 b , \ t m p \ ( ) . 1 6 b
.endm
/ *
* aesbs_ x t s _ e n c r y p t ( u 8 o u t [ ] , u 8 c o n s t i n [ ] , u 8 c o n s t r k [ ] , i n t r o u n d s ,
* int b l o c k s , u 8 i v [ ] )
* aesbs_ x t s _ d e c r y p t ( u 8 o u t [ ] , u 8 c o n s t i n [ ] , u 8 c o n s t r k [ ] , i n t r o u n d s ,
* int b l o c k s , u 8 i v [ ] )
* /
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ S T A R T _ L O C A L ( _ _ x t s _ c r y p t 8 )
2017-01-11 19:41:55 +03:00
mov x6 , #1
2018-04-30 19:18:25 +03:00
lsl x6 , x6 , x23
subs w23 , w23 , #8
csel x23 , x23 , x z r , p l
2017-01-11 19:41:55 +03:00
csel x6 , x6 , x z r , m i
2018-04-30 19:18:25 +03:00
ld1 { v0 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
next_ t w e a k v26 , v25 , v30 , v31
eor v0 . 1 6 b , v0 . 1 6 b , v25 . 1 6 b
tbnz x6 , #1 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v1 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
next_ t w e a k v27 , v26 , v30 , v31
eor v1 . 1 6 b , v1 . 1 6 b , v26 . 1 6 b
tbnz x6 , #2 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v2 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
next_ t w e a k v28 , v27 , v30 , v31
eor v2 . 1 6 b , v2 . 1 6 b , v27 . 1 6 b
tbnz x6 , #3 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v3 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
next_ t w e a k v29 , v28 , v30 , v31
eor v3 . 1 6 b , v3 . 1 6 b , v28 . 1 6 b
tbnz x6 , #4 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v4 . 1 6 b } , [ x20 ] , #16
str q29 , [ s p , #. L f r a m e _ l o c a l _ o f f s e t ]
2017-01-11 19:41:55 +03:00
eor v4 . 1 6 b , v4 . 1 6 b , v29 . 1 6 b
next_ t w e a k v29 , v29 , v30 , v31
tbnz x6 , #5 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v5 . 1 6 b } , [ x20 ] , #16
str q29 , [ s p , #. L f r a m e _ l o c a l _ o f f s e t + 16 ]
2017-01-11 19:41:55 +03:00
eor v5 . 1 6 b , v5 . 1 6 b , v29 . 1 6 b
next_ t w e a k v29 , v29 , v30 , v31
tbnz x6 , #6 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v6 . 1 6 b } , [ x20 ] , #16
str q29 , [ s p , #. L f r a m e _ l o c a l _ o f f s e t + 32 ]
2017-01-11 19:41:55 +03:00
eor v6 . 1 6 b , v6 . 1 6 b , v29 . 1 6 b
next_ t w e a k v29 , v29 , v30 , v31
tbnz x6 , #7 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v7 . 1 6 b } , [ x20 ] , #16
str q29 , [ s p , #. L f r a m e _ l o c a l _ o f f s e t + 48 ]
2017-01-11 19:41:55 +03:00
eor v7 . 1 6 b , v7 . 1 6 b , v29 . 1 6 b
next_ t w e a k v29 , v29 , v30 , v31
2018-04-30 19:18:25 +03:00
0 : mov b s k e y , x21
mov r o u n d s , x22
2020-10-06 19:33:26 +03:00
br x16
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ E N D ( _ _ x t s _ c r y p t 8 )
2017-01-11 19:41:55 +03:00
.macro _ _ xts_ c r y p t , d o 8 , o 0 , o 1 , o 2 , o 3 , o 4 , o 5 , o 6 , o 7
2018-04-30 19:18:25 +03:00
frame_ p u s h 6 , 6 4
2017-01-11 19:41:55 +03:00
2018-04-30 19:18:25 +03:00
mov x19 , x0
mov x20 , x1
mov x21 , x2
mov x22 , x3
mov x23 , x4
mov x24 , x5
2021-02-03 14:36:23 +03:00
movi v30 . 2 s , #0x1
2019-09-03 19:43:28 +03:00
movi v25 . 2 s , #0x87
uzp1 v30 . 4 s , v30 . 4 s , v25 . 4 s
2018-04-30 19:18:25 +03:00
ld1 { v25 . 1 6 b } , [ x24 ]
2017-01-11 19:41:55 +03:00
2020-10-06 19:33:26 +03:00
99 : adr x16 , \ d o 8
2017-01-11 19:41:55 +03:00
bl _ _ x t s _ c r y p t 8
2018-04-30 19:18:25 +03:00
ldp q16 , q17 , [ s p , #. L f r a m e _ l o c a l _ o f f s e t ]
ldp q18 , q19 , [ s p , #. L f r a m e _ l o c a l _ o f f s e t + 32 ]
2017-01-11 19:41:55 +03:00
eor \ o 0 \ ( ) . 1 6 b , \ o 0 \ ( ) . 1 6 b , v25 . 1 6 b
eor \ o 1 \ ( ) . 1 6 b , \ o 1 \ ( ) . 1 6 b , v26 . 1 6 b
eor \ o 2 \ ( ) . 1 6 b , \ o 2 \ ( ) . 1 6 b , v27 . 1 6 b
eor \ o 3 \ ( ) . 1 6 b , \ o 3 \ ( ) . 1 6 b , v28 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { \ o 0 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v25 . 1 6 b , v26 . 1 6 b
tbnz x6 , #1 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 1 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v25 . 1 6 b , v27 . 1 6 b
tbnz x6 , #2 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 2 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v25 . 1 6 b , v28 . 1 6 b
tbnz x6 , #3 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 3 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
mov v25 . 1 6 b , v29 . 1 6 b
tbnz x6 , #4 , 1 f
eor \ o 4 \ ( ) . 1 6 b , \ o 4 \ ( ) . 1 6 b , v16 . 1 6 b
eor \ o 5 \ ( ) . 1 6 b , \ o 5 \ ( ) . 1 6 b , v17 . 1 6 b
eor \ o 6 \ ( ) . 1 6 b , \ o 6 \ ( ) . 1 6 b , v18 . 1 6 b
eor \ o 7 \ ( ) . 1 6 b , \ o 7 \ ( ) . 1 6 b , v19 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { \ o 4 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x6 , #5 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 5 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x6 , #6 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 6 \ ( ) . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x6 , #7 , 1 f
2018-04-30 19:18:25 +03:00
st1 { \ o 7 \ ( ) . 1 6 b } , [ x19 ] , #16
cbz x23 , 1 f
st1 { v25 . 1 6 b } , [ x24 ]
2017-01-11 19:41:55 +03:00
2018-04-30 19:18:25 +03:00
b 9 9 b
2017-01-11 19:41:55 +03:00
2018-04-30 19:18:25 +03:00
1 : st1 { v25 . 1 6 b } , [ x24 ]
frame_ p o p
2017-01-11 19:41:55 +03:00
ret
.endm
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ S T A R T ( a e s b s _ x t s _ e n c r y p t )
2017-01-11 19:41:55 +03:00
_ _ xts_ c r y p t a e s b s _ e n c r y p t 8 , v0 , v1 , v4 , v6 , v3 , v7 , v2 , v5
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ E N D ( a e s b s _ x t s _ e n c r y p t )
2017-01-11 19:41:55 +03:00
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ S T A R T ( a e s b s _ x t s _ d e c r y p t )
2017-01-11 19:41:55 +03:00
_ _ xts_ c r y p t a e s b s _ d e c r y p t 8 , v0 , v1 , v6 , v4 , v2 , v7 , v3 , v5
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ E N D ( a e s b s _ x t s _ d e c r y p t )
2017-01-11 19:41:55 +03:00
.macro next_ c t r , v
mov \ v \ ( ) . d [ 1 ] , x8
adds x8 , x8 , #1
mov \ v \ ( ) . d [ 0 ] , x7
adc x7 , x7 , x z r
rev6 4 \ v \ ( ) . 1 6 b , \ v \ ( ) . 1 6 b
.endm
/ *
* aesbs_ c t r _ e n c r y p t ( u 8 o u t [ ] , u 8 c o n s t i n [ ] , u 8 c o n s t r k [ ] ,
2017-02-02 14:38:55 +03:00
* int r o u n d s , i n t b l o c k s , u 8 i v [ ] , u 8 f i n a l [ ] )
2017-01-11 19:41:55 +03:00
* /
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ S T A R T ( a e s b s _ c t r _ e n c r y p t )
2018-04-30 19:18:25 +03:00
frame_ p u s h 8
mov x19 , x0
mov x20 , x1
mov x21 , x2
mov x22 , x3
mov x23 , x4
mov x24 , x5
mov x25 , x6
cmp x25 , #0
cset x26 , n e
add x23 , x23 , x26 / / d o o n e e x t r a b l o c k i f f i n a l
2021-02-03 14:36:23 +03:00
ldp x7 , x8 , [ x24 ]
2018-04-30 19:18:25 +03:00
ld1 { v0 . 1 6 b } , [ x24 ]
2017-01-11 19:41:55 +03:00
CPU_ L E ( r e v x7 , x7 )
CPU_ L E ( r e v x8 , x8 )
adds x8 , x8 , #1
adc x7 , x7 , x z r
99 : mov x9 , #1
2018-04-30 19:18:25 +03:00
lsl x9 , x9 , x23
subs w23 , w23 , #8
csel x23 , x23 , x z r , p l
2017-01-11 19:41:55 +03:00
csel x9 , x9 , x z r , l e
2017-02-02 14:38:55 +03:00
tbnz x9 , #1 , 0 f
2017-01-11 19:41:55 +03:00
next_ c t r v1
2017-02-02 14:38:55 +03:00
tbnz x9 , #2 , 0 f
2017-01-11 19:41:55 +03:00
next_ c t r v2
2017-02-02 14:38:55 +03:00
tbnz x9 , #3 , 0 f
2017-01-11 19:41:55 +03:00
next_ c t r v3
2017-02-02 14:38:55 +03:00
tbnz x9 , #4 , 0 f
2017-01-11 19:41:55 +03:00
next_ c t r v4
2017-02-02 14:38:55 +03:00
tbnz x9 , #5 , 0 f
2017-01-11 19:41:55 +03:00
next_ c t r v5
2017-02-02 14:38:55 +03:00
tbnz x9 , #6 , 0 f
2017-01-11 19:41:55 +03:00
next_ c t r v6
2017-02-02 14:38:55 +03:00
tbnz x9 , #7 , 0 f
2017-01-11 19:41:55 +03:00
next_ c t r v7
2018-04-30 19:18:25 +03:00
0 : mov b s k e y , x21
mov r o u n d s , x22
2017-01-11 19:41:55 +03:00
bl a e s b s _ e n c r y p t 8
2018-04-30 19:18:25 +03:00
lsr x9 , x9 , x26 / / d i s r e g a r d t h e e x t r a b l o c k
2017-01-11 19:41:55 +03:00
tbnz x9 , #0 , 0 f
2018-04-30 19:18:25 +03:00
ld1 { v8 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
eor v0 . 1 6 b , v0 . 1 6 b , v8 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { v0 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x9 , #1 , 1 f
2018-04-30 19:18:25 +03:00
ld1 { v9 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
eor v1 . 1 6 b , v1 . 1 6 b , v9 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { v1 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x9 , #2 , 2 f
2018-04-30 19:18:25 +03:00
ld1 { v10 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
eor v4 . 1 6 b , v4 . 1 6 b , v10 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { v4 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x9 , #3 , 3 f
2018-04-30 19:18:25 +03:00
ld1 { v11 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
eor v6 . 1 6 b , v6 . 1 6 b , v11 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { v6 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x9 , #4 , 4 f
2018-04-30 19:18:25 +03:00
ld1 { v12 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
eor v3 . 1 6 b , v3 . 1 6 b , v12 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { v3 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x9 , #5 , 5 f
2018-04-30 19:18:25 +03:00
ld1 { v13 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
eor v7 . 1 6 b , v7 . 1 6 b , v13 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { v7 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x9 , #6 , 6 f
2018-04-30 19:18:25 +03:00
ld1 { v14 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
eor v2 . 1 6 b , v2 . 1 6 b , v14 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { v2 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
tbnz x9 , #7 , 7 f
2018-04-30 19:18:25 +03:00
ld1 { v15 . 1 6 b } , [ x20 ] , #16
2017-01-11 19:41:55 +03:00
eor v5 . 1 6 b , v5 . 1 6 b , v15 . 1 6 b
2018-04-30 19:18:25 +03:00
st1 { v5 . 1 6 b } , [ x19 ] , #16
2017-01-11 19:41:55 +03:00
2017-02-02 14:38:55 +03:00
8 : next_ c t r v0
2018-04-30 19:18:25 +03:00
st1 { v0 . 1 6 b } , [ x24 ]
2019-02-01 10:51:42 +03:00
cbz x23 , . L c t r _ d o n e
2018-04-30 19:18:25 +03:00
b 9 9 b
2017-01-11 19:41:55 +03:00
2019-02-01 10:51:42 +03:00
.Lctr_done :
frame_ p o p
2017-01-11 19:41:55 +03:00
ret
/ *
2017-02-02 14:38:55 +03:00
* If w e a r e h a n d l i n g t h e t a i l o f t h e i n p u t ( x6 ! = N U L L ) , r e t u r n t h e
* final k e y s t r e a m b l o c k b a c k t o t h e c a l l e r .
2017-01-11 19:41:55 +03:00
* /
2019-02-01 10:51:42 +03:00
0 : cbz x25 , 8 b
st1 { v0 . 1 6 b } , [ x25 ]
b 8 b
2018-04-30 19:18:25 +03:00
1 : cbz x25 , 8 b
st1 { v1 . 1 6 b } , [ x25 ]
2017-01-11 19:41:55 +03:00
b 8 b
2018-04-30 19:18:25 +03:00
2 : cbz x25 , 8 b
st1 { v4 . 1 6 b } , [ x25 ]
2017-01-11 19:41:55 +03:00
b 8 b
2018-04-30 19:18:25 +03:00
3 : cbz x25 , 8 b
st1 { v6 . 1 6 b } , [ x25 ]
2017-01-11 19:41:55 +03:00
b 8 b
2018-04-30 19:18:25 +03:00
4 : cbz x25 , 8 b
st1 { v3 . 1 6 b } , [ x25 ]
2017-01-11 19:41:55 +03:00
b 8 b
2018-04-30 19:18:25 +03:00
5 : cbz x25 , 8 b
st1 { v7 . 1 6 b } , [ x25 ]
2017-01-11 19:41:55 +03:00
b 8 b
2018-04-30 19:18:25 +03:00
6 : cbz x25 , 8 b
st1 { v2 . 1 6 b } , [ x25 ]
2017-01-11 19:41:55 +03:00
b 8 b
2018-04-30 19:18:25 +03:00
7 : cbz x25 , 8 b
st1 { v5 . 1 6 b } , [ x25 ]
2017-01-11 19:41:55 +03:00
b 8 b
2019-12-13 18:49:10 +03:00
SYM_ F U N C _ E N D ( a e s b s _ c t r _ e n c r y p t )