// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 #include "sha256_defs.h" #define K256_0 UINT32_C(0x428a2f98) #define K256_1 UINT32_C(0x71374491) #define K256_2 UINT32_C(0xb5c0fbcf) #define K256_3 UINT32_C(0xe9b5dba5) #define K256_4 UINT32_C(0x3956c25b) #define K256_5 UINT32_C(0x59f111f1) #define K256_6 UINT32_C(0x923f82a4) #define K256_7 UINT32_C(0xab1c5ed5) #define K256_8 UINT32_C(0xd807aa98) #define K256_9 UINT32_C(0x12835b01) #define K256_10 UINT32_C(0x243185be) #define K256_11 UINT32_C(0x550c7dc3) #define K256_12 UINT32_C(0x72be5d74) #define K256_13 UINT32_C(0x80deb1fe) #define K256_14 UINT32_C(0x9bdc06a7) #define K256_15 UINT32_C(0xc19bf174) #define K256_16 UINT32_C(0xe49b69c1) #define K256_17 UINT32_C(0xefbe4786) #define K256_18 UINT32_C(0x0fc19dc6) #define K256_19 UINT32_C(0x240ca1cc) #define K256_20 UINT32_C(0x2de92c6f) #define K256_21 UINT32_C(0x4a7484aa) #define K256_22 UINT32_C(0x5cb0a9dc) #define K256_23 UINT32_C(0x76f988da) #define K256_24 UINT32_C(0x983e5152) #define K256_25 UINT32_C(0xa831c66d) #define K256_26 UINT32_C(0xb00327c8) #define K256_27 UINT32_C(0xbf597fc7) #define K256_28 UINT32_C(0xc6e00bf3) #define K256_29 UINT32_C(0xd5a79147) #define K256_30 UINT32_C(0x06ca6351) #define K256_31 UINT32_C(0x14292967) #define K256_32 UINT32_C(0x27b70a85) #define K256_33 UINT32_C(0x2e1b2138) #define K256_34 UINT32_C(0x4d2c6dfc) #define K256_35 UINT32_C(0x53380d13) #define K256_36 UINT32_C(0x650a7354) #define K256_37 UINT32_C(0x766a0abb) #define K256_38 UINT32_C(0x81c2c92e) #define K256_39 UINT32_C(0x92722c85) #define K256_40 UINT32_C(0xa2bfe8a1) #define K256_41 UINT32_C(0xa81a664b) #define K256_42 UINT32_C(0xc24b8b70) #define K256_43 UINT32_C(0xc76c51a3) #define K256_44 UINT32_C(0xd192e819) #define K256_45 UINT32_C(0xd6990624) #define K256_46 UINT32_C(0xf40e3585) #define K256_47 UINT32_C(0x106aa070) #define K256_48 UINT32_C(0x19a4c116) #define K256_49 UINT32_C(0x1e376c08) #define K256_50 UINT32_C(0x2748774c) #define K256_51 UINT32_C(0x34b0bcb5) #define K256_52 UINT32_C(0x391c0cb3) #define K256_53 UINT32_C(0x4ed8aa4a) #define K256_54 UINT32_C(0x5b9cca4f) #define K256_55 UINT32_C(0x682e6ff3) #define K256_56 UINT32_C(0x748f82ee) #define K256_57 UINT32_C(0x78a5636f) #define K256_58 UINT32_C(0x84c87814) #define K256_59 UINT32_C(0x8cc70208) #define K256_60 UINT32_C(0x90befffa) #define K256_61 UINT32_C(0xa4506ceb) #define K256_62 UINT32_C(0xbef9a3f7) #define K256_63 UINT32_C(0xc67178f2) ALIGN(64) const sha256_word_t K256[SHA256_ROUNDS_NUM] = { K256_0, K256_1, K256_2, K256_3, K256_4, K256_5, K256_6, K256_7, K256_8, K256_9, K256_10, K256_11, K256_12, K256_13, K256_14, K256_15, K256_16, K256_17, K256_18, K256_19, K256_20, K256_21, K256_22, K256_23, K256_24, K256_25, K256_26, K256_27, K256_28, K256_29, K256_30, K256_31, K256_32, K256_33, K256_34, K256_35, K256_36, K256_37, K256_38, K256_39, K256_40, K256_41, K256_42, K256_43, K256_44, K256_45, K256_46, K256_47, K256_48, K256_49, K256_50, K256_51, K256_52, K256_53, K256_54, K256_55, K256_56, K256_57, K256_58, K256_59, K256_60, K256_61, K256_62, K256_63}; ALIGN(64) const sha256_word_t K256x2[2 * SHA256_ROUNDS_NUM] = { DUP2(K256_0, K256_1, K256_2, K256_3), DUP2(K256_4, K256_5, K256_6, K256_7), DUP2(K256_8, K256_9, K256_10, K256_11), DUP2(K256_12, K256_13, K256_14, K256_15), DUP2(K256_16, K256_17, K256_18, K256_19), DUP2(K256_20, K256_21, K256_22, K256_23), DUP2(K256_24, K256_25, K256_26, K256_27), DUP2(K256_28, K256_29, K256_30, K256_31), DUP2(K256_32, K256_33, K256_34, K256_35), DUP2(K256_36, K256_37, K256_38, K256_39), DUP2(K256_40, K256_41, K256_42, K256_43), DUP2(K256_44, K256_45, K256_46, K256_47), DUP2(K256_48, K256_49, K256_50, K256_51), DUP2(K256_52, K256_53, K256_54, K256_55), DUP2(K256_56, K256_57, K256_58, K256_59), DUP2(K256_60, K256_61, K256_62, K256_63)}; ALIGN(64) const sha256_word_t K256x4[4 * SHA256_ROUNDS_NUM] = { DUP4(K256_0, K256_1, K256_2, K256_3), DUP4(K256_4, K256_5, K256_6, K256_7), DUP4(K256_8, K256_9, K256_10, K256_11), DUP4(K256_12, K256_13, K256_14, K256_15), DUP4(K256_16, K256_17, K256_18, K256_19), DUP4(K256_20, K256_21, K256_22, K256_23), DUP4(K256_24, K256_25, K256_26, K256_27), DUP4(K256_28, K256_29, K256_30, K256_31), DUP4(K256_32, K256_33, K256_34, K256_35), DUP4(K256_36, K256_37, K256_38, K256_39), DUP4(K256_40, K256_41, K256_42, K256_43), DUP4(K256_44, K256_45, K256_46, K256_47), DUP4(K256_48, K256_49, K256_50, K256_51), DUP4(K256_52, K256_53, K256_54, K256_55), DUP4(K256_56, K256_57, K256_58, K256_59), DUP4(K256_60, K256_61, K256_62, K256_63)};