public void Schedule(ref Vector128 <uint> schedule, ref byte message) { int i = 0; Vector128 <uint> W0, W1, W2, W3, W4, W5, W6, W7, W8, W9, W10, W11, W12, W13, W14, W15; W0 = Ssse3.Shuffle(Gather(ref message).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W1 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 1)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W2 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 2)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W3 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 3)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W4 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 4)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W5 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 5)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W6 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 6)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W7 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 7)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W8 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 8)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W9 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 9)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W10 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 10)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W11 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 11)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W12 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 12)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W13 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 13)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W14 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 14)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); W15 = Ssse3.Shuffle(Gather(ref Unsafe.Add(ref message, 4 * 15)).AsByte(), Sha256Helper.LittleEndianMask128).AsUInt32(); while (i < 32) { W0 = Schedule(W0, W1, W9, W14, i++, ref schedule); W1 = Schedule(W1, W2, W10, W15, i++, ref schedule); W2 = Schedule(W2, W3, W11, W0, i++, ref schedule); W3 = Schedule(W3, W4, W12, W1, i++, ref schedule); W4 = Schedule(W4, W5, W13, W2, i++, ref schedule); W5 = Schedule(W5, W6, W14, W3, i++, ref schedule); W6 = Schedule(W6, W7, W15, W4, i++, ref schedule); W7 = Schedule(W7, W8, W0, W5, i++, ref schedule); W8 = Schedule(W8, W9, W1, W6, i++, ref schedule); W9 = Schedule(W9, W10, W2, W7, i++, ref schedule); W10 = Schedule(W10, W11, W3, W8, i++, ref schedule); W11 = Schedule(W11, W12, W4, W9, i++, ref schedule); W12 = Schedule(W12, W13, W5, W10, i++, ref schedule); W13 = Schedule(W13, W14, W6, W11, i++, ref schedule); W14 = Schedule(W14, W15, W7, W12, i++, ref schedule); W15 = Schedule(W15, W0, W8, W13, i++, ref schedule); } W0 = Schedule(W0, W1, W9, W14, i++, ref schedule); Unsafe.Add(ref schedule, 48) = Sse3.Add(W0, Unsafe.Add(ref K, 48)); W1 = Schedule(W1, W2, W10, W15, i++, ref schedule); Unsafe.Add(ref schedule, 49) = Sse3.Add(W1, Unsafe.Add(ref K, 49)); W2 = Schedule(W2, W3, W11, W0, i++, ref schedule); Unsafe.Add(ref schedule, 50) = Sse3.Add(W2, Unsafe.Add(ref K, 50)); W3 = Schedule(W3, W4, W12, W1, i++, ref schedule); Unsafe.Add(ref schedule, 51) = Sse3.Add(W3, Unsafe.Add(ref K, 51)); W4 = Schedule(W4, W5, W13, W2, i++, ref schedule); Unsafe.Add(ref schedule, 52) = Sse3.Add(W4, Unsafe.Add(ref K, 52)); W5 = Schedule(W5, W6, W14, W3, i++, ref schedule); Unsafe.Add(ref schedule, 53) = Sse3.Add(W5, Unsafe.Add(ref K, 53)); W6 = Schedule(W6, W7, W15, W4, i++, ref schedule); Unsafe.Add(ref schedule, 54) = Sse3.Add(W6, Unsafe.Add(ref K, 54)); W7 = Schedule(W7, W8, W0, W5, i++, ref schedule); Unsafe.Add(ref schedule, 55) = Sse3.Add(W7, Unsafe.Add(ref K, 55)); W8 = Schedule(W8, W9, W1, W6, i++, ref schedule); Unsafe.Add(ref schedule, 56) = Sse3.Add(W8, Unsafe.Add(ref K, 56)); W9 = Schedule(W9, W10, W2, W7, i++, ref schedule); Unsafe.Add(ref schedule, 57) = Sse3.Add(W9, Unsafe.Add(ref K, 57)); W10 = Schedule(W10, W11, W3, W8, i++, ref schedule); Unsafe.Add(ref schedule, 58) = Sse3.Add(W10, Unsafe.Add(ref K, 58)); W11 = Schedule(W11, W12, W4, W9, i++, ref schedule); Unsafe.Add(ref schedule, 59) = Sse3.Add(W11, Unsafe.Add(ref K, 59)); W12 = Schedule(W12, W13, W5, W10, i++, ref schedule); Unsafe.Add(ref schedule, 60) = Sse3.Add(W12, Unsafe.Add(ref K, 60)); W13 = Schedule(W13, W14, W6, W11, i++, ref schedule); Unsafe.Add(ref schedule, 61) = Sse3.Add(W13, Unsafe.Add(ref K, 61)); W14 = Schedule(W14, W15, W7, W12, i++, ref schedule); Unsafe.Add(ref schedule, 62) = Sse3.Add(W14, Unsafe.Add(ref K, 62)); W15 = Schedule(W15, W0, W8, W13, i, ref schedule); Unsafe.Add(ref schedule, 63) = Sse3.Add(W15, Unsafe.Add(ref K, 63)); }