lib/crypto/arm64/sm3-neon-core.S

Source file repositories/reference/linux-study-clean/lib/crypto/arm64/sm3-neon-core.S

File Facts

System
Linux kernel
Corpus path
lib/crypto/arm64/sm3-neon-core.S
Extension
.S
Size
22010 bytes
Lines
601
Domain
Kernel Services
Bucket
lib
Inferred role
Kernel Services: lib
Status
atlas-only

Why This File Exists

Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * sm3-neon-core.S - SM3 secure hash using NEON instructions
 *
 * Linux/arm64 port of the libgcrypt SM3 implementation for AArch64
 *
 * Copyright (C) 2021 Jussi Kivilinna <jussi.kivilinna@iki.fi>
 * Copyright (c) 2022 Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
 */

#include <linux/linkage.h>
#include <asm/assembler.h>

/* Context structure */

#define state_h0 0
#define state_h1 4
#define state_h2 8
#define state_h3 12
#define state_h4 16
#define state_h5 20
#define state_h6 24
#define state_h7 28

/* Stack structure */

#define STACK_W_SIZE        (32 * 2 * 3)

#define STACK_W             (0)
#define STACK_SIZE          (STACK_W + STACK_W_SIZE)

/* Register macros */

#define RSTATE x0
#define RDATA  x1
#define RNBLKS x2
#define RKPTR  x28
#define RFRAME x29

#define ra w3
#define rb w4
#define rc w5
#define rd w6
#define re w7
#define rf w8
#define rg w9
#define rh w10

#define t0 w11
#define t1 w12
#define t2 w13
#define t3 w14
#define t4 w15
#define t5 w16
#define t6 w17

#define k_even w19
#define k_odd w20

#define addr0 x21
#define addr1 x22

#define s0 w23
#define s1 w24
#define s2 w25
#define s3 w26

#define W0 v0
#define W1 v1
#define W2 v2

Annotation

Implementation Notes