lib/crypto/x86/blake2s-core.S

Source file repositories/reference/linux-study-clean/lib/crypto/x86/blake2s-core.S

File Facts

System
Linux kernel
Corpus path
lib/crypto/x86/blake2s-core.S
Extension
.S
Size
8459 bytes
Lines
292
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

#include <linux/linkage.h>

.section .rodata.cst32.iv, "aM", @progbits, 32
.align 32
.Liv:
	.octa 0xA54FF53A3C6EF372BB67AE856A09E667
	.octa 0x5BE0CD191F83D9AB9B05688C510E527F

.section .rodata.cst16.ror16, "aM", @progbits, 16
.align 16
.Lror16:
	.octa 0x0D0C0F0E09080B0A0504070601000302

.section .rodata.cst16.ror8, "aM", @progbits, 16
.align 16
.Lror8:
	.octa 0x0C0F0E0D080B0A090407060500030201

.section .rodata.cst64.sigma, "aM", @progbits, 160
.align 64
.Lsigma:
.byte  0,  2,  4,  6,  1,  3,  5,  7, 14,  8, 10, 12, 15,  9, 11, 13
.byte 14,  4,  9, 13, 10,  8, 15,  6,  5,  1,  0, 11,  3, 12,  2,  7
.byte 11, 12,  5, 15,  8,  0,  2, 13,  9, 10,  3,  7,  4, 14,  6,  1
.byte  7,  3, 13, 11,  9,  1, 12, 14, 15,  2,  5,  4,  8,  6, 10,  0
.byte  9,  5,  2, 10,  0,  7,  4, 15,  3, 14, 11,  6, 13,  1, 12,  8
.byte  2,  6,  0,  8, 12, 10, 11,  3,  1,  4,  7, 15,  9, 13,  5, 14
.byte 12,  1, 14,  4,  5, 15, 13, 10,  8,  0,  6,  9, 11,  7,  3,  2
.byte 13,  7, 12,  3, 11, 14,  1,  9,  2,  5, 15,  8, 10,  0,  4,  6
.byte  6, 14, 11,  0, 15,  9,  3,  8, 10, 12, 13,  1,  5,  2,  7,  4
.byte 10,  8,  7,  1,  2,  4,  6,  5, 13, 15,  9,  3,  0, 11, 14, 12

.section .rodata.cst64.sigma2, "aM", @progbits, 160
.align 64
.Lsigma2:
.byte  0,  2,  4,  6,  1,  3,  5,  7, 14,  8, 10, 12, 15,  9, 11, 13
.byte  8,  2, 13, 15, 10,  9, 12,  3,  6,  4,  0, 14,  5, 11,  1,  7
.byte 11, 13,  8,  6,  5, 10, 14,  3,  2,  4, 12, 15,  1,  0,  7,  9
.byte 11, 10,  7,  0,  8, 15,  1, 13,  3,  6,  2, 12,  4, 14,  9,  5
.byte  4, 10,  9, 14, 15,  0, 11,  8,  1,  7,  3, 13,  2,  5,  6, 12
.byte  2, 11,  4, 15, 14,  3, 10,  8, 13,  6,  5,  7,  0, 12,  1,  9
.byte  4,  8, 15,  9, 14, 11, 13,  5,  3,  2,  1, 12,  6, 10,  7,  0
.byte  6, 13,  0, 14, 12,  2,  1, 11, 15,  4,  5,  8,  7,  9,  3, 10
.byte 15,  5,  4, 13, 10,  7,  3, 11, 12,  2,  0,  6,  9,  8,  1, 14
.byte  8,  7, 14, 11, 13, 15,  0, 12, 10,  4,  5,  6,  3,  2,  1,  9

#define CTX		%rdi
#define DATA		%rsi
#define NBLOCKS		%rdx
#define INC		%ecx

.text
//
// void blake2s_compress_ssse3(struct blake2s_ctx *ctx,
//			       const u8 *data, size_t nblocks, u32 inc);
//
// Only the first three fields of struct blake2s_ctx are used:
//	u32 h[8];	(inout)
//	u32 t[2];	(inout)
//	u32 f[2];	(in)
//
SYM_FUNC_START(blake2s_compress_ssse3)
	movdqu		(CTX),%xmm0		// Load h[0..3]
	movdqu		16(CTX),%xmm1		// Load h[4..7]
	movdqa		.Lror16(%rip),%xmm12
	movdqa		.Lror8(%rip),%xmm13
	movdqu		32(CTX),%xmm14		// Load t and f
	movd		INC,%xmm15		// Load inc
	leaq		.Lsigma+160(%rip),%r8
	jmp		.Lssse3_mainloop

Annotation

Implementation Notes