func blockSHANI() { … } func roundLoop() { … } func done() { … } var digestPtr … var dataPtr … var numBytes … var sha256Constants … var msg … var state0 … var state1 … var m0 … var m1 … var m2 … var m3 … var m4 … var shufMask … var abefSave … var cdghSave … // nop instead of final SHA256MSG1 for first and last few rounds func nop(m, a VecPhysical) { … } // final SHA256MSG1 for middle rounds that require it func sha256msg1(m, a VecPhysical) { … } // msg copy for all but rounds 12-15 func vmov(a, b VecPhysical) { … } // reverse copy for rounds 12-15 func vmovrev(a, b VecPhysical) { … } type VecFunc … // sha rounds 0 to 11 // // identical with the exception of the final msg op // which is replaced with a nop for rounds where it is not needed // refer to Gulley, et al for more information func rounds0to11(m, a VecPhysical, c int, sha256msg1 VecFunc) { … } // sha rounds 12 to 59 // // identical with the exception of the final msg op // and the reverse copy(m,msg) in round 12 which is required // after the last data load // refer to Gulley, et al for more information func rounds12to59(m VecPhysical, c int, a, t VecPhysical, sha256msg1, movop VecFunc) { … }