Lm1:
for i, j being Nat st i <> 0 & i < j & j is prime holds
i,j are_coprime
Lm2:
for i, j, k being Nat st j is prime & i < j & k < j & i <> 0 holds
ex a being Nat st (a * i) mod j = k
theorem Th1:
for
i,
j,
k being
Nat st
j is
prime &
i < j &
k < j &
i <> 0 holds
ex
a being
Nat st
(
(a * i) mod j = k &
a < j )
theorem Th2:
for
n,
k1,
k2 being
Nat st
n <> 0 &
k1 mod n = k2 mod n &
k1 <= k2 holds
ex
t being
Nat st
k2 - k1 = n * t
theorem Th3:
for
a,
b being
Nat holds
a - b <= a
theorem Th4:
for
b1,
b2,
c being
Nat st
b2 <= c holds
b2 - b1 <= c
theorem Th14:
for
i,
j,
k,
n being
Nat holds
ADD_MOD (
(ADD_MOD (i,j,n)),
k,
n)
= ADD_MOD (
i,
(ADD_MOD (j,k,n)),
n)
theorem Th23:
for
i,
j,
k,
n being
Nat st
(2 to_power n) + 1 is
prime &
i is_expressible_by n &
j is_expressible_by n &
k is_expressible_by n holds
MUL_MOD (
(MUL_MOD (i,j,n)),
k,
n)
= MUL_MOD (
i,
(MUL_MOD (j,k,n)),
n)
definition
let n be
Nat;
let m,
k be
FinSequence of
NAT ;
func IDEAoperationA (
m,
k,
n)
-> FinSequence of
NAT means :
Def11:
(
len it = len m & ( for
i being
Nat st
i in dom m holds
( (
i = 1 implies
it . i = MUL_MOD (
(m . 1),
(k . 1),
n) ) & (
i = 2 implies
it . i = ADD_MOD (
(m . 2),
(k . 2),
n) ) & (
i = 3 implies
it . i = ADD_MOD (
(m . 3),
(k . 3),
n) ) & (
i = 4 implies
it . i = MUL_MOD (
(m . 4),
(k . 4),
n) ) & (
i <> 1 &
i <> 2 &
i <> 3 &
i <> 4 implies
it . i = m . i ) ) ) );
existence
ex b1 being FinSequence of NAT st
( len b1 = len m & ( for i being Nat st i in dom m holds
( ( i = 1 implies b1 . i = MUL_MOD ((m . 1),(k . 1),n) ) & ( i = 2 implies b1 . i = ADD_MOD ((m . 2),(k . 2),n) ) & ( i = 3 implies b1 . i = ADD_MOD ((m . 3),(k . 3),n) ) & ( i = 4 implies b1 . i = MUL_MOD ((m . 4),(k . 4),n) ) & ( i <> 1 & i <> 2 & i <> 3 & i <> 4 implies b1 . i = m . i ) ) ) )
uniqueness
for b1, b2 being FinSequence of NAT st len b1 = len m & ( for i being Nat st i in dom m holds
( ( i = 1 implies b1 . i = MUL_MOD ((m . 1),(k . 1),n) ) & ( i = 2 implies b1 . i = ADD_MOD ((m . 2),(k . 2),n) ) & ( i = 3 implies b1 . i = ADD_MOD ((m . 3),(k . 3),n) ) & ( i = 4 implies b1 . i = MUL_MOD ((m . 4),(k . 4),n) ) & ( i <> 1 & i <> 2 & i <> 3 & i <> 4 implies b1 . i = m . i ) ) ) & len b2 = len m & ( for i being Nat st i in dom m holds
( ( i = 1 implies b2 . i = MUL_MOD ((m . 1),(k . 1),n) ) & ( i = 2 implies b2 . i = ADD_MOD ((m . 2),(k . 2),n) ) & ( i = 3 implies b2 . i = ADD_MOD ((m . 3),(k . 3),n) ) & ( i = 4 implies b2 . i = MUL_MOD ((m . 4),(k . 4),n) ) & ( i <> 1 & i <> 2 & i <> 3 & i <> 4 implies b2 . i = m . i ) ) ) holds
b1 = b2
end;
::
deftheorem Def11 defines
IDEAoperationA IDEA_1:def 11 :
for n being Nat
for m, k, b4 being FinSequence of NAT holds
( b4 = IDEAoperationA (m,k,n) iff ( len b4 = len m & ( for i being Nat st i in dom m holds
( ( i = 1 implies b4 . i = MUL_MOD ((m . 1),(k . 1),n) ) & ( i = 2 implies b4 . i = ADD_MOD ((m . 2),(k . 2),n) ) & ( i = 3 implies b4 . i = ADD_MOD ((m . 3),(k . 3),n) ) & ( i = 4 implies b4 . i = MUL_MOD ((m . 4),(k . 4),n) ) & ( i <> 1 & i <> 2 & i <> 3 & i <> 4 implies b4 . i = m . i ) ) ) ) );
definition
let n be non
zero Nat;
let m,
k be
FinSequence of
NAT ;
func IDEAoperationB (
m,
k,
n)
-> FinSequence of
NAT means :
Def12:
(
len it = len m & ( for
i being
Nat st
i in dom m holds
( (
i = 1 implies
it . i = Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)))) ) & (
i = 2 implies
it . i = Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)),n)))) ) & (
i = 3 implies
it . i = Absval ((n -BinarySequence (m . 3)) 'xor' (n -BinarySequence (MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)))) ) & (
i = 4 implies
it . i = Absval ((n -BinarySequence (m . 4)) 'xor' (n -BinarySequence (ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)),n)))) ) & (
i <> 1 &
i <> 2 &
i <> 3 &
i <> 4 implies
it . i = m . i ) ) ) );
existence
ex b1 being FinSequence of NAT st
( len b1 = len m & ( for i being Nat st i in dom m holds
( ( i = 1 implies b1 . i = Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)))) ) & ( i = 2 implies b1 . i = Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)),n)))) ) & ( i = 3 implies b1 . i = Absval ((n -BinarySequence (m . 3)) 'xor' (n -BinarySequence (MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)))) ) & ( i = 4 implies b1 . i = Absval ((n -BinarySequence (m . 4)) 'xor' (n -BinarySequence (ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)),n)))) ) & ( i <> 1 & i <> 2 & i <> 3 & i <> 4 implies b1 . i = m . i ) ) ) )
uniqueness
for b1, b2 being FinSequence of NAT st len b1 = len m & ( for i being Nat st i in dom m holds
( ( i = 1 implies b1 . i = Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)))) ) & ( i = 2 implies b1 . i = Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)),n)))) ) & ( i = 3 implies b1 . i = Absval ((n -BinarySequence (m . 3)) 'xor' (n -BinarySequence (MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)))) ) & ( i = 4 implies b1 . i = Absval ((n -BinarySequence (m . 4)) 'xor' (n -BinarySequence (ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)),n)))) ) & ( i <> 1 & i <> 2 & i <> 3 & i <> 4 implies b1 . i = m . i ) ) ) & len b2 = len m & ( for i being Nat st i in dom m holds
( ( i = 1 implies b2 . i = Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)))) ) & ( i = 2 implies b2 . i = Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)),n)))) ) & ( i = 3 implies b2 . i = Absval ((n -BinarySequence (m . 3)) 'xor' (n -BinarySequence (MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)))) ) & ( i = 4 implies b2 . i = Absval ((n -BinarySequence (m . 4)) 'xor' (n -BinarySequence (ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)),n)))) ) & ( i <> 1 & i <> 2 & i <> 3 & i <> 4 implies b2 . i = m . i ) ) ) holds
b1 = b2
end;
::
deftheorem Def12 defines
IDEAoperationB IDEA_1:def 12 :
for n being non zero Nat
for m, k, b4 being FinSequence of NAT holds
( b4 = IDEAoperationB (m,k,n) iff ( len b4 = len m & ( for i being Nat st i in dom m holds
( ( i = 1 implies b4 . i = Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)))) ) & ( i = 2 implies b4 . i = Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)),n)))) ) & ( i = 3 implies b4 . i = Absval ((n -BinarySequence (m . 3)) 'xor' (n -BinarySequence (MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)))) ) & ( i = 4 implies b4 . i = Absval ((n -BinarySequence (m . 4)) 'xor' (n -BinarySequence (ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(MUL_MOD ((ADD_MOD ((MUL_MOD ((Absval ((n -BinarySequence (m . 1)) 'xor' (n -BinarySequence (m . 3)))),(k . 5),n)),(Absval ((n -BinarySequence (m . 2)) 'xor' (n -BinarySequence (m . 4)))),n)),(k . 6),n)),n)))) ) & ( i <> 1 & i <> 2 & i <> 3 & i <> 4 implies b4 . i = m . i ) ) ) ) );
definition
let m be
FinSequence of
NAT ;
existence
ex b1 being FinSequence of NAT st
( len b1 = len m & ( for i being Nat st i in dom m holds
b1 . i = IFEQ (i,2,(m . 3),(IFEQ (i,3,(m . 2),(m . i)))) ) )
uniqueness
for b1, b2 being FinSequence of NAT st len b1 = len m & ( for i being Nat st i in dom m holds
b1 . i = IFEQ (i,2,(m . 3),(IFEQ (i,3,(m . 2),(m . i)))) ) & len b2 = len m & ( for i being Nat st i in dom m holds
b2 . i = IFEQ (i,2,(m . 3),(IFEQ (i,3,(m . 2),(m . i)))) ) holds
b1 = b2
end;
Lm3:
for m being FinSequence of NAT
for i being Nat st i = 2 & i in dom m holds
(IDEAoperationC m) . i = m . 3
Lm4:
for m being FinSequence of NAT
for i being Nat st i = 3 & i in dom m holds
(IDEAoperationC m) . i = m . 2
Lm5:
for m being FinSequence of NAT
for i being Nat st i <> 2 & i <> 3 & i in dom m holds
(IDEAoperationC m) . i = m . i
theorem Th29:
for
n being non
zero Nat for
m,
k1,
k2 being
FinSequence of
NAT st
(2 to_power n) + 1 is
prime &
len m >= 4 &
m . 1
is_expressible_by n &
m . 2
is_expressible_by n &
m . 3
is_expressible_by n &
m . 4
is_expressible_by n &
k1 . 1
is_expressible_by n &
k1 . 2
is_expressible_by n &
k1 . 3
is_expressible_by n &
k1 . 4
is_expressible_by n &
k2 . 1
= INV_MOD (
(k1 . 1),
n) &
k2 . 2
= NEG_MOD (
(k1 . 2),
n) &
k2 . 3
= NEG_MOD (
(k1 . 3),
n) &
k2 . 4
= INV_MOD (
(k1 . 4),
n) holds
IDEAoperationA (
(IDEAoperationA (m,k1,n)),
k2,
n)
= m
theorem Th30:
for
n being non
zero Nat for
m,
k1,
k2 being
FinSequence of
NAT st
(2 to_power n) + 1 is
prime &
len m >= 4 &
m . 1
is_expressible_by n &
m . 2
is_expressible_by n &
m . 3
is_expressible_by n &
m . 4
is_expressible_by n &
k1 . 1
is_expressible_by n &
k1 . 2
is_expressible_by n &
k1 . 3
is_expressible_by n &
k1 . 4
is_expressible_by n &
k2 . 1
= INV_MOD (
(k1 . 1),
n) &
k2 . 2
= NEG_MOD (
(k1 . 3),
n) &
k2 . 3
= NEG_MOD (
(k1 . 2),
n) &
k2 . 4
= INV_MOD (
(k1 . 4),
n) holds
IDEAoperationA (
(IDEAoperationC (IDEAoperationA ((IDEAoperationC m),k1,n))),
k2,
n)
= m
definition
let n be non
zero Nat;
let k be
FinSequence of
NAT ;
existence
ex b1 being Function of MESSAGES,MESSAGES st
for m being FinSequence of NAT holds b1 . m = IDEAoperationA ((IDEAoperationC (IDEAoperationB (m,k,n))),k,n)
uniqueness
for b1, b2 being Function of MESSAGES,MESSAGES st ( for m being FinSequence of NAT holds b1 . m = IDEAoperationA ((IDEAoperationC (IDEAoperationB (m,k,n))),k,n) ) & ( for m being FinSequence of NAT holds b2 . m = IDEAoperationA ((IDEAoperationC (IDEAoperationB (m,k,n))),k,n) ) holds
b1 = b2
end;
definition
let n be non
zero Nat;
let k be
FinSequence of
NAT ;
existence
ex b1 being Function of MESSAGES,MESSAGES st
for m being FinSequence of NAT holds b1 . m = IDEAoperationB ((IDEAoperationA ((IDEAoperationC m),k,n)),k,n)
uniqueness
for b1, b2 being Function of MESSAGES,MESSAGES st ( for m being FinSequence of NAT holds b1 . m = IDEAoperationB ((IDEAoperationA ((IDEAoperationC m),k,n)),k,n) ) & ( for m being FinSequence of NAT holds b2 . m = IDEAoperationB ((IDEAoperationA ((IDEAoperationC m),k,n)),k,n) ) holds
b1 = b2
end;
definition
let r,
lk be
Nat;
let n be non
zero Nat;
let Key be
Matrix of
lk,6,
NAT;
existence
ex b1 being FinSequence st
( len b1 = r & ( for i being Nat st i in dom b1 holds
b1 . i = IDEA_P ((Line (Key,i)),n) ) )
uniqueness
for b1, b2 being FinSequence st len b1 = r & ( for i being Nat st i in dom b1 holds
b1 . i = IDEA_P ((Line (Key,i)),n) ) & len b2 = r & ( for i being Nat st i in dom b2 holds
b2 . i = IDEA_P ((Line (Key,i)),n) ) holds
b1 = b2
end;
definition
let r,
lk be
Nat;
let n be non
zero Nat;
let Key be
Matrix of
lk,6,
NAT;
existence
ex b1 being FinSequence st
( len b1 = r & ( for i being Nat st i in dom b1 holds
b1 . i = IDEA_Q ((Line (Key,((r -' i) + 1))),n) ) )
uniqueness
for b1, b2 being FinSequence st len b1 = r & ( for i being Nat st i in dom b1 holds
b1 . i = IDEA_Q ((Line (Key,((r -' i) + 1))),n) ) & len b2 = r & ( for i being Nat st i in dom b2 holds
b2 . i = IDEA_Q ((Line (Key,((r -' i) + 1))),n) ) holds
b1 = b2
end;
definition
let n be non
zero Nat;
let k be
FinSequence of
NAT ;
existence
ex b1 being Function of MESSAGES,MESSAGES st
for m being FinSequence of NAT holds b1 . m = IDEAoperationA ((IDEAoperationB (m,k,n)),k,n)
uniqueness
for b1, b2 being Function of MESSAGES,MESSAGES st ( for m being FinSequence of NAT holds b1 . m = IDEAoperationA ((IDEAoperationB (m,k,n)),k,n) ) & ( for m being FinSequence of NAT holds b2 . m = IDEAoperationA ((IDEAoperationB (m,k,n)),k,n) ) holds
b1 = b2
end;
definition
let n be non
zero Nat;
let k be
FinSequence of
NAT ;
existence
ex b1 being Function of MESSAGES,MESSAGES st
for m being FinSequence of NAT holds b1 . m = IDEAoperationB ((IDEAoperationA (m,k,n)),k,n)
uniqueness
for b1, b2 being Function of MESSAGES,MESSAGES st ( for m being FinSequence of NAT holds b1 . m = IDEAoperationB ((IDEAoperationA (m,k,n)),k,n) ) & ( for m being FinSequence of NAT holds b2 . m = IDEAoperationB ((IDEAoperationA (m,k,n)),k,n) ) holds
b1 = b2
end;
theorem Th46:
for
n being non
zero Nat for
lk being
Nat for
Key1,
Key2 being
Matrix of
lk,6,
NAT for
r being
Nat for
m being
FinSequence of
NAT st
lk >= r &
(2 to_power n) + 1 is
prime &
len m >= 4 &
m . 1
is_expressible_by n &
m . 2
is_expressible_by n &
m . 3
is_expressible_by n &
m . 4
is_expressible_by n & ( for
i being
Nat st
i <= r holds
(
Key1 * (
i,1)
is_expressible_by n &
Key1 * (
i,2)
is_expressible_by n &
Key1 * (
i,3)
is_expressible_by n &
Key1 * (
i,4)
is_expressible_by n &
Key1 * (
i,5)
is_expressible_by n &
Key1 * (
i,6)
is_expressible_by n &
Key2 * (
i,1)
is_expressible_by n &
Key2 * (
i,2)
is_expressible_by n &
Key2 * (
i,3)
is_expressible_by n &
Key2 * (
i,4)
is_expressible_by n &
Key2 * (
i,5)
is_expressible_by n &
Key2 * (
i,6)
is_expressible_by n &
Key2 * (
i,1)
= INV_MOD (
(Key1 * (i,1)),
n) &
Key2 * (
i,2)
= NEG_MOD (
(Key1 * (i,3)),
n) &
Key2 * (
i,3)
= NEG_MOD (
(Key1 * (i,2)),
n) &
Key2 * (
i,4)
= INV_MOD (
(Key1 * (i,4)),
n) &
Key1 * (
i,5)
= Key2 * (
i,5) &
Key1 * (
i,6)
= Key2 * (
i,6) ) ) holds
(compose (((IDEA_P_F (Key1,n,r)) ^ (IDEA_Q_F (Key2,n,r))),MESSAGES)) . m = m
theorem
for
n being non
zero Nat for
lk being
Nat for
Key1,
Key2 being
Matrix of
lk,6,
NAT for
r being
Nat for
ks1,
ks2,
ke1,
ke2,
m being
FinSequence of
NAT st
lk >= r &
(2 to_power n) + 1 is
prime &
len m >= 4 &
m . 1
is_expressible_by n &
m . 2
is_expressible_by n &
m . 3
is_expressible_by n &
m . 4
is_expressible_by n & ( for
i being
Nat st
i <= r holds
(
Key1 * (
i,1)
is_expressible_by n &
Key1 * (
i,2)
is_expressible_by n &
Key1 * (
i,3)
is_expressible_by n &
Key1 * (
i,4)
is_expressible_by n &
Key1 * (
i,5)
is_expressible_by n &
Key1 * (
i,6)
is_expressible_by n &
Key2 * (
i,1)
is_expressible_by n &
Key2 * (
i,2)
is_expressible_by n &
Key2 * (
i,3)
is_expressible_by n &
Key2 * (
i,4)
is_expressible_by n &
Key2 * (
i,5)
is_expressible_by n &
Key2 * (
i,6)
is_expressible_by n &
Key2 * (
i,1)
= INV_MOD (
(Key1 * (i,1)),
n) &
Key2 * (
i,2)
= NEG_MOD (
(Key1 * (i,3)),
n) &
Key2 * (
i,3)
= NEG_MOD (
(Key1 * (i,2)),
n) &
Key2 * (
i,4)
= INV_MOD (
(Key1 * (i,4)),
n) &
Key1 * (
i,5)
= Key2 * (
i,5) &
Key1 * (
i,6)
= Key2 * (
i,6) ) ) &
ks1 . 1
is_expressible_by n &
ks1 . 2
is_expressible_by n &
ks1 . 3
is_expressible_by n &
ks1 . 4
is_expressible_by n &
ks2 . 1
= INV_MOD (
(ks1 . 1),
n) &
ks2 . 2
= NEG_MOD (
(ks1 . 2),
n) &
ks2 . 3
= NEG_MOD (
(ks1 . 3),
n) &
ks2 . 4
= INV_MOD (
(ks1 . 4),
n) &
ke1 . 1
is_expressible_by n &
ke1 . 2
is_expressible_by n &
ke1 . 3
is_expressible_by n &
ke1 . 4
is_expressible_by n &
ke2 . 1
= INV_MOD (
(ke1 . 1),
n) &
ke2 . 2
= NEG_MOD (
(ke1 . 2),
n) &
ke2 . 3
= NEG_MOD (
(ke1 . 3),
n) &
ke2 . 4
= INV_MOD (
(ke1 . 4),
n) &
ke2 . 5
= ke1 . 5 &
ke2 . 6
= ke1 . 6 holds
((IDEA_QS (ks2,n)) * ((compose ((IDEA_Q_F (Key2,n,r)),MESSAGES)) * ((IDEA_QE (ke2,n)) * ((IDEA_PE (ke1,n)) * ((compose ((IDEA_P_F (Key1,n,r)),MESSAGES)) * (IDEA_PS (ks1,n))))))) . m = m
:: Fixed-length bit Integer.
:: IDEA's Basic operators are 'xor', ADD_MOD and MUL_MOD.
:: 'xor' is 16-bitwise XOR. ADD_MOD is addition mod 2^{16}.
:: MUL_MOD is multiplication mod 2^(16)+1. And, we define
:: two functions NEG_MOD and INV_MOD that give inverse
:: element of ADD_MOD and MUL_MOD respectively.