MDC-4 Calculation

The MDC-4 calculation consists of this procedure:
MDC-4 (n, text, KEY1, KEY2, MDC);
   For i := 1, 2,...n do
      Call MDC-1(KEY1,KEY2,T8<i>,T8<i>,OUT1,OUT2)
      Set KEY1int := OUT1
      Set KEY2int := OUT2
      Call MDC-1(KEY1int,KEY2int,KEY2,KEY1,OUT1,OUT2)
      Set KEY1 := OUT1
      Set KEY2 := OUT2
   End do
   Set output MDC := (KEY1 || KEY2)
End procedure