clang 20.0.0git
Macros | Functions
shaintrin.h File Reference

Go to the source code of this file.

Macros

#define __DEFAULT_FN_ATTRS   __attribute__((__always_inline__, __nodebug__, __target__("sha"), __min_vector_width__(128)))
 
#define _mm_sha1rnds4_epu32(V1, V2, M)    __builtin_ia32_sha1rnds4((__v4si)(__m128i)(V1), (__v4si)(__m128i)(V2), (M))
 Performs four iterations of the inner loop of the SHA-1 message digest algorithm using the starting SHA-1 state (A, B, C, D) from the 128-bit vector of [4 x i32] in V1 and the next four 32-bit elements of the message from the 128-bit vector of [4 x i32] in V2.
 

Functions

static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha1nexte_epu32 (__m128i __X, __m128i __Y)
 Calculates the SHA-1 state variable E from the SHA-1 state variables in the 128-bit vector of [4 x i32] in __X, adds that to the next set of four message elements in the 128-bit vector of [4 x i32] in __Y, and returns the result.
 
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha1msg1_epu32 (__m128i __X, __m128i __Y)
 Performs an intermediate calculation for deriving the next four SHA-1 message elements using previous message elements from the 128-bit vectors of [4 x i32] in __X and __Y, and returns the result.
 
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha1msg2_epu32 (__m128i __X, __m128i __Y)
 Performs the final calculation for deriving the next four SHA-1 message elements using previous message elements from the 128-bit vectors of [4 x i32] in __X and __Y, and returns the result.
 
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha256rnds2_epu32 (__m128i __X, __m128i __Y, __m128i __Z)
 Performs two rounds of SHA-256 operation using the following inputs: a starting SHA-256 state (C, D, G, H) from the 128-bit vector of [4 x i32] in __X; a starting SHA-256 state (A, B, E, F) from the 128-bit vector of [4 x i32] in __Y; and a pre-computed sum of the next two message elements (unsigned 32-bit integers) and corresponding rounding constants from the 128-bit vector of [4 x i32] in __Z.
 
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha256msg1_epu32 (__m128i __X, __m128i __Y)
 Performs an intermediate calculation for deriving the next four SHA-256 message elements using previous message elements from the 128-bit vectors of [4 x i32] in __X and __Y, and returns the result.
 
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha256msg2_epu32 (__m128i __X, __m128i __Y)
 Performs the final calculation for deriving the next four SHA-256 message elements using previous message elements from the 128-bit vectors of [4 x i32] in __X and __Y, and returns the result.
 

Macro Definition Documentation

◆ __DEFAULT_FN_ATTRS

#define __DEFAULT_FN_ATTRS   __attribute__((__always_inline__, __nodebug__, __target__("sha"), __min_vector_width__(128)))

Definition at line 18 of file shaintrin.h.

◆ _mm_sha1rnds4_epu32

#define _mm_sha1rnds4_epu32 (   V1,
  V2,
 
)     __builtin_ia32_sha1rnds4((__v4si)(__m128i)(V1), (__v4si)(__m128i)(V2), (M))

Performs four iterations of the inner loop of the SHA-1 message digest algorithm using the starting SHA-1 state (A, B, C, D) from the 128-bit vector of [4 x i32] in V1 and the next four 32-bit elements of the message from the 128-bit vector of [4 x i32] in V2.

Note that the SHA-1 state variable E must have already been added to V2 (_mm_sha1nexte_epu32() can perform this step). Returns the updated SHA-1 state (A, B, C, D) as a 128-bit vector of [4 x i32].

The SHA-1 algorithm has an inner loop of 80 iterations, twenty each with a different combining function and rounding constant. This intrinsic performs four iterations using a combining function and rounding constant selected by M[1:0].

__m128i _mm_sha1rnds4_epu32(__m128i V1, __m128i V2, const int M);
#define _mm_sha1rnds4_epu32(V1, V2, M)
Performs four iterations of the inner loop of the SHA-1 message digest algorithm using the starting S...
Definition: shaintrin.h:50

This intrinsic corresponds to the SHA1RNDS4 instruction.

Parameters
V1A 128-bit vector of [4 x i32] containing the initial SHA-1 state.
V2A 128-bit vector of [4 x i32] containing the next four elements of the message, plus SHA-1 state variable E.
MAn immediate value where bits [1:0] select among four possible combining functions and rounding constants (not specified here).
Returns
A 128-bit vector of [4 x i32] containing the updated SHA-1 state.

Definition at line 50 of file shaintrin.h.

Function Documentation

◆ _mm_sha1msg1_epu32()

static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha1msg1_epu32 ( __m128i  __X,
__m128i  __Y 
)
static

Performs an intermediate calculation for deriving the next four SHA-1 message elements using previous message elements from the 128-bit vectors of [4 x i32] in __X and __Y, and returns the result.

This intrinsic corresponds to the SHA1MSG1 instruction.

Parameters
__XA 128-bit vector of [4 x i32] containing previous message elements.
__YA 128-bit vector of [4 x i32] containing previous message elements.
Returns
A 128-bit vector of [4 x i32] containing the derived SHA-1 elements.

Definition at line 90 of file shaintrin.h.

References __Y.

◆ _mm_sha1msg2_epu32()

static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha1msg2_epu32 ( __m128i  __X,
__m128i  __Y 
)
static

Performs the final calculation for deriving the next four SHA-1 message elements using previous message elements from the 128-bit vectors of [4 x i32] in __X and __Y, and returns the result.

This intrinsic corresponds to the SHA1MSG2 instruction.

Parameters
__XA 128-bit vector of [4 x i32] containing an intermediate result.
__YA 128-bit vector of [4 x i32] containing previous message values.
Returns
A 128-bit vector of [4 x i32] containing the updated SHA-1 values.

Definition at line 110 of file shaintrin.h.

References __Y.

◆ _mm_sha1nexte_epu32()

static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha1nexte_epu32 ( __m128i  __X,
__m128i  __Y 
)
static

Calculates the SHA-1 state variable E from the SHA-1 state variables in the 128-bit vector of [4 x i32] in __X, adds that to the next set of four message elements in the 128-bit vector of [4 x i32] in __Y, and returns the result.

This intrinsic corresponds to the SHA1NEXTE instruction.

Parameters
__XA 128-bit vector of [4 x i32] containing the current SHA-1 state.
__YA 128-bit vector of [4 x i32] containing the next four elements of the message.
Returns
A 128-bit vector of [4 x i32] containing the updated SHA-1 values.

Definition at line 70 of file shaintrin.h.

References __Y.

◆ _mm_sha256msg1_epu32()

static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha256msg1_epu32 ( __m128i  __X,
__m128i  __Y 
)
static

Performs an intermediate calculation for deriving the next four SHA-256 message elements using previous message elements from the 128-bit vectors of [4 x i32] in __X and __Y, and returns the result.

This intrinsic corresponds to the SHA256MSG1 instruction.

Parameters
__XA 128-bit vector of [4 x i32] containing previous message elements.
__YA 128-bit vector of [4 x i32] containing previous message elements.
Returns
A 128-bit vector of [4 x i32] containing the updated SHA-256 values.

Definition at line 162 of file shaintrin.h.

References __Y.

◆ _mm_sha256msg2_epu32()

static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha256msg2_epu32 ( __m128i  __X,
__m128i  __Y 
)
static

Performs the final calculation for deriving the next four SHA-256 message elements using previous message elements from the 128-bit vectors of [4 x i32] in __X and __Y, and returns the result.

This intrinsic corresponds to the SHA256MSG2 instruction.

Parameters
__XA 128-bit vector of [4 x i32] containing an intermediate result.
__YA 128-bit vector of [4 x i32] containing previous message values.
Returns
A 128-bit vector of [4 x i32] containing the updated SHA-256 values.

Definition at line 182 of file shaintrin.h.

References __Y.

◆ _mm_sha256rnds2_epu32()

static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha256rnds2_epu32 ( __m128i  __X,
__m128i  __Y,
__m128i  __Z 
)
static

Performs two rounds of SHA-256 operation using the following inputs: a starting SHA-256 state (C, D, G, H) from the 128-bit vector of [4 x i32] in __X; a starting SHA-256 state (A, B, E, F) from the 128-bit vector of [4 x i32] in __Y; and a pre-computed sum of the next two message elements (unsigned 32-bit integers) and corresponding rounding constants from the 128-bit vector of [4 x i32] in __Z.

Returns the updated SHA-256 state (A, B, E, F) as a 128-bit vector of [4 x i32].

The SHA-256 algorithm has a core loop of 64 iterations. This intrinsic performs two of those iterations.

This intrinsic corresponds to the SHA256RNDS2 instruction.

Parameters
__XA 128-bit vector of [4 x i32] containing part of the initial SHA-256 state.
__YA 128-bit vector of [4 x i32] containing part of the initial SHA-256 state.
__ZA 128-bit vector of [4 x i32] containing additional input to the SHA-256 operation.
Returns
A 128-bit vector of [4 x i32] containing the updated SHA-1 state.

Definition at line 142 of file shaintrin.h.

References __Y.