git.sr.ht/~pingoo/stdx@v0.0.0-20240218134121-094174641f6e/crypto/chacha/const.s (about)

     1  // Copyright (c) 2018 Andreas Auernhammer. All rights reserved.
     2  // Use of this source code is governed by a license that can be
     3  // found in the LICENSE file.
     4  
     5  // +build 386,!gccgo,!appengine,!nacl amd64,!gccgo,!appengine,!nacl
     6  
     7  #include "textflag.h"
     8  
     9  DATA ·sigma<>+0x00(SB)/4, $0x61707865
    10  DATA ·sigma<>+0x04(SB)/4, $0x3320646e
    11  DATA ·sigma<>+0x08(SB)/4, $0x79622d32
    12  DATA ·sigma<>+0x0C(SB)/4, $0x6b206574
    13  GLOBL ·sigma<>(SB), (NOPTR+RODATA), $16 // The 4 ChaCha initialization constants
    14  
    15  // SSE2/SSE3/AVX constants
    16  
    17  DATA ·one<>+0x00(SB)/8, $1
    18  DATA ·one<>+0x08(SB)/8, $0
    19  GLOBL ·one<>(SB), (NOPTR+RODATA), $16 // The constant 1 as 128 bit value
    20  
    21  DATA ·rol16<>+0x00(SB)/8, $0x0504070601000302
    22  DATA ·rol16<>+0x08(SB)/8, $0x0D0C0F0E09080B0A
    23  GLOBL ·rol16<>(SB), (NOPTR+RODATA), $16 // The PSHUFB 16 bit left rotate constant
    24  
    25  DATA ·rol8<>+0x00(SB)/8, $0x0605040702010003
    26  DATA ·rol8<>+0x08(SB)/8, $0x0E0D0C0F0A09080B
    27  GLOBL ·rol8<>(SB), (NOPTR+RODATA), $16 // The PSHUFB 8 bit left rotate constant
    28  
    29  // AVX2 constants
    30  
    31  DATA ·one_AVX2<>+0x00(SB)/8, $0
    32  DATA ·one_AVX2<>+0x08(SB)/8, $0
    33  DATA ·one_AVX2<>+0x10(SB)/8, $1
    34  DATA ·one_AVX2<>+0x18(SB)/8, $0
    35  GLOBL ·one_AVX2<>(SB), (NOPTR+RODATA), $32 // The constant 1 as 256 bit value
    36  
    37  DATA ·two_AVX2<>+0x00(SB)/8, $2
    38  DATA ·two_AVX2<>+0x08(SB)/8, $0
    39  DATA ·two_AVX2<>+0x10(SB)/8, $2
    40  DATA ·two_AVX2<>+0x18(SB)/8, $0
    41  GLOBL ·two_AVX2<>(SB), (NOPTR+RODATA), $32
    42  
    43  DATA ·rol16_AVX2<>+0x00(SB)/8, $0x0504070601000302
    44  DATA ·rol16_AVX2<>+0x08(SB)/8, $0x0D0C0F0E09080B0A
    45  DATA ·rol16_AVX2<>+0x10(SB)/8, $0x0504070601000302
    46  DATA ·rol16_AVX2<>+0x18(SB)/8, $0x0D0C0F0E09080B0A
    47  GLOBL ·rol16_AVX2<>(SB), (NOPTR+RODATA), $32 // The VPSHUFB 16 bit left rotate constant
    48  
    49  DATA ·rol8_AVX2<>+0x00(SB)/8, $0x0605040702010003
    50  DATA ·rol8_AVX2<>+0x08(SB)/8, $0x0E0D0C0F0A09080B
    51  DATA ·rol8_AVX2<>+0x10(SB)/8, $0x0605040702010003
    52  DATA ·rol8_AVX2<>+0x18(SB)/8, $0x0E0D0C0F0A09080B
    53  GLOBL ·rol8_AVX2<>(SB), (NOPTR+RODATA), $32 // The VPSHUFB 8 bit left rotate constant