vec_shasigma_be

Purpose

Performs a secure hash computation in accordance with Federal Information Processing Standards FIPS-180-3, which is a specification for the Secure Hash Standard.

This built-in function is valid only when you include the altivec.h file.

Syntax

d=vec_shasigma_be(a, b, c)

Result and argument types

The following table describes the types of the returned value and the function arguments.

Table 1. Types of the returned value and function arguments
d a b1 c2
vector unsigned int vector unsigned int const int const int
vector unsigned long long vector unsigned long long const int const int
Notes:
  1. b selects the function type, which can be either lowercase sigma (σ) or uppercase sigma (∑). The argument must be a constant expression with a value of 0 or 1.
  2. c selects the function subtype, which can be either sigma-0 (σ0 or ∑0) or sigma-1 (σ1 or ∑1). The argument must be a constant expression with a value in the range 0 - 15 inclusive.

Result value

  • If a is of type vector unsigned int, for each element i (i = 0,1,2,3) of a, element i of the returned value is the result of the following SHA-256 function:
    • σ0(x[i]), if b is 0 and bit i of the 4-bit c is 0
    • σ1(x[i]), if b is 0 and bit i of the 4-bit c is 1
    • ∑0(x[i]), if b is nonzero and bit i of the 4-bit c is 0
    • ∑1(x[i]), if b is nonzero and bit i of the 4-bit c is 1
  • If a is of type vector unsigned long long, for each element i (i = 0,1) of a, element i of the returned value is the result of the following SHA-512 function:
    • σ0(x[i]), if b is 0 and bit 2*i of the 4-bit c is 0
    • σ1(x[i]), if b is 0 and bit 2*i of the 4-bit c is 1
    • ∑0(x[i]), if b is nonzero and bit 2*i of the 4-bit c is 0
    • ∑1(x[i]), if b is nonzero and bit 2*i of the 4-bit c is 1


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us