VEC_SHASIGMA_BE(ARG1,ARG2,ARG3)
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 -qarch is set to target POWER8® processors.
Class
Elemental function
Argument type and attributes
- ARG1
- An INTENT(IN) UNSIGNED(4) or UNSIGNED(8) vector
- ARG2
- An INTENT(IN) integer
The argument must be a constant expression with a value of 0 or 1. It selects the function type, which can be either lowercase sigma (σ) or uppercase sigma (∑).
- ARG3
- An INTENT(IN) integer
The argument must be a constant expression with a value in the range 0 - 15 inclusive. It selects the function subtype, which can be either sigma-0 (σ0 or ∑0) or sigma-1 (σ1 or ∑1).
Result type and attributes
The result has the same type and type parameters as ARG1.
Result value
- If ARG1 is an UNSIGNED(4) vector, for
each element i (i = 0,1,2,3)
of ARG1,
element i of the returned value is the result of
the following SHA-256 function:
- σ0(x[i]), if ARG2 is 0 and bit i of the 4-bit ARG3 is 0
- σ1(x[i]), if ARG2 is 0 and bit i of the 4-bit ARG3 is 1
- ∑0(x[i]), if ARG2 is nonzero and bit i of the 4-bit ARG3 is 0
- ∑1(x[i]), if ARG2 is nonzero and bit i of the 4-bit ARG3 is 1
- If ARG1 is an UNSIGNED(8) vector,
for each element i (i = 0,1)
of ARG1,
element i of the returned value is the result of
the following SHA-512 function:
- σ0(x[i]), if ARG2 is 0 and bit 2*i of the 4-bit ARG3 is 0
- σ1(x[i]), if ARG2 is 0 and bit 2*i of the 4-bit ARG3 is 1
- ∑0(x[i]), if ARG2 is nonzero and bit 2*i of the 4-bit ARG3 is 0
- ∑1(x[i]), if ARG2 is nonzero and bit 2*i of the 4-bit ARG3 is 1