@@ -328,6 +328,12 @@ def termToConcrete
328328 | .u8Mul τ e a b => do
329329 pure (.u8Mul (← typToConcrete mono τ) e
330330 (← termToConcrete mono a) (← termToConcrete mono b))
331+ | .u8ChainRotr7 τ e a b => do
332+ pure (.u8ChainRotr7 (← typToConcrete mono τ) e
333+ (← termToConcrete mono a) (← termToConcrete mono b))
334+ | .u8ChainRotr4 τ e a b => do
335+ pure (.u8ChainRotr4 (← typToConcrete mono τ) e
336+ (← termToConcrete mono a) (← termToConcrete mono b))
331337 | .u8Sub τ e a b => do
332338 pure (.u8Sub (← typToConcrete mono τ) e
333339 (← termToConcrete mono a) (← termToConcrete mono b))
@@ -526,6 +532,10 @@ def rewriteTypedTerm (decls : Typed.Decls)
526532 (rewriteTypedTerm decls subst mono a) (rewriteTypedTerm decls subst mono b)
527533 | .u8Mul τ e a b => .u8Mul (rewriteTyp subst mono τ) e
528534 (rewriteTypedTerm decls subst mono a) (rewriteTypedTerm decls subst mono b)
535+ | .u8ChainRotr7 τ e a b => .u8ChainRotr7 (rewriteTyp subst mono τ) e
536+ (rewriteTypedTerm decls subst mono a) (rewriteTypedTerm decls subst mono b)
537+ | .u8ChainRotr4 τ e a b => .u8ChainRotr4 (rewriteTyp subst mono τ) e
538+ (rewriteTypedTerm decls subst mono a) (rewriteTypedTerm decls subst mono b)
529539 | .u8Sub τ e a b => .u8Sub (rewriteTyp subst mono τ) e
530540 (rewriteTypedTerm decls subst mono a) (rewriteTypedTerm decls subst mono b)
531541 | .u8And τ e a b => .u8And (rewriteTyp subst mono τ) e
@@ -603,6 +613,7 @@ def collectInTypedTerm (seen : Std.HashSet (Global × Array Typ)) :
603613 args.attach.foldl (fun s ⟨a, _⟩ => collectInTypedTerm s a) seen
604614 | .add τ _ a b | .sub τ _ a b | .mul τ _ a b
605615 | .u8Xor τ _ a b | .u8Add τ _ a b | .u8Mul τ _ a b | .u8Sub τ _ a b
616+ | .u8ChainRotr7 τ _ a b | .u8ChainRotr4 τ _ a b
606617 | .u8And τ _ a b | .u8Or τ _ a b
607618 | .u8LessThan τ _ a b | .u32LessThan τ _ a b =>
608619 collectInTypedTerm (collectInTypedTerm (collectInTyp seen τ) a) b
@@ -665,6 +676,7 @@ def collectCalls (decls : Typed.Decls)
665676 bs.attach.foldl (fun s ⟨(_, b), _⟩ => collectCalls decls s b) seen
666677 | .add _ _ a b | .sub _ _ a b | .mul _ _ a b
667678 | .u8Xor _ _ a b | .u8Add _ _ a b | .u8Mul _ _ a b | .u8Sub _ _ a b
679+ | .u8ChainRotr7 _ _ a b | .u8ChainRotr4 _ _ a b
668680 | .u8And _ _ a b | .u8Or _ _ a b
669681 | .u8LessThan _ _ a b | .u32LessThan _ _ a b =>
670682 collectCalls decls (collectCalls decls seen a) b
@@ -756,6 +768,10 @@ def substInTypedTerm (subst : Global → Option Typ) : Typed.Term → Typed.Term
756768 (substInTypedTerm subst a) (substInTypedTerm subst b)
757769 | .u8Mul τ e a b => .u8Mul (Typ.instantiate subst τ) e
758770 (substInTypedTerm subst a) (substInTypedTerm subst b)
771+ | .u8ChainRotr7 τ e a b => .u8ChainRotr7 (Typ.instantiate subst τ) e
772+ (substInTypedTerm subst a) (substInTypedTerm subst b)
773+ | .u8ChainRotr4 τ e a b => .u8ChainRotr4 (Typ.instantiate subst τ) e
774+ (substInTypedTerm subst a) (substInTypedTerm subst b)
759775 | .u8Sub τ e a b => .u8Sub (Typ.instantiate subst τ) e
760776 (substInTypedTerm subst a) (substInTypedTerm subst b)
761777 | .u8And τ e a b => .u8And (Typ.instantiate subst τ) e
0 commit comments