Explorer

core.sha256-rounds

description
The working variables a to h after the rounds from round to 63 of the SHA-256 compression function
type
Fn(words: List<Number>, state: List<Number>, round: Number) -> List<Number>
expression
fn(words$0, state$1, round$2) =>
  match @core.less-than(left: $2, right: 64) {
    false =>
      $1,
    true =>
      let a$3 = @core.number-at-or-zero(list: $1, index: 0);
      let b$4 = @core.number-at-or-zero(list: $1, index: 1);
      let c$5 = @core.number-at-or-zero(list: $1, index: 2);
      let d$6 = @core.number-at-or-zero(list: $1, index: 3);
      let e$7 = @core.number-at-or-zero(list: $1, index: 4);
      let f$8 = @core.number-at-or-zero(list: $1, index: 5);
      let g$9 = @core.number-at-or-zero(list: $1, index: 6);
      let h$10 = @core.number-at-or-zero(list: $1, index: 7);
      let t1$11 = @core.uint32(
          value: @core.plus(
            left: @core.plus(
              left: @core.plus(
                left: @core.plus(
                  left: $10,
                  right: @core.bit-xor(
                    left: @core.bit-xor(
                      left: @core.rotate-right-32(value: $7, amount: 6),
                      right: @core.rotate-right-32(value: $7, amount: 11)
                    ),
                    right: @core.rotate-right-32(value: $7, amount: 25)
                  )
                ),
                right: @core.bit-xor(
                  left: @core.bit-and(left: $7, right: $8),
                  right: @core.bit-and(left: @core.bit-xor(left: $7, right: 4294967295), right: $9)
                )
              ),
              right: @core.number-at-or-zero(list: @core.sha256-round-constants, index: $2)
            ),
            right: @core.number-at-or-zero(list: $0, index: $2)
          )
        );
      let t2$12 = @core.uint32(
          value: @core.plus(
            left: @core.bit-xor(
              left: @core.bit-xor(
                left: @core.rotate-right-32(value: $3, amount: 2),
                right: @core.rotate-right-32(value: $3, amount: 13)
              ),
              right: @core.rotate-right-32(value: $3, amount: 22)
            ),
            right: @core.bit-xor(
              left: @core.bit-xor(left: @core.bit-and(left: $3, right: $4), right: @core.bit-and(left: $3, right: $5)),
              right: @core.bit-and(left: $4, right: $5)
            )
          )
        );
      @core.sha256-rounds(
        words: $0,
        state: [
          @core.uint32(value: @core.plus(left: $11, right: $12)),
          $3,
          $4,
          $5,
          @core.uint32(value: @core.plus(left: $6, right: $11)),
          $7,
          $8,
          $9
        ],
        round: @core.plus(left: $2, right: 1)
      )
  }
visibility
public
core.sha256-rounds (project definy, branch main, snapshot CfIAXM725tR74SWd4aoTUz4-JJQfqnllblZbQ2Sv204)
id: LgkOnft3w5Q1UgADxjnWSZWCK3dxKd0nOHCzc-TpWNY
content hash: pHVOieq21m1mmKKYaMsJZr4zB1Ji9I4K76694rk3hhw