renamed keys

This commit is contained in:
2024-05-22 20:03:17 -05:00
parent 0927eb197c
commit 895143e746
4 changed files with 560 additions and 556 deletions

View File

@@ -5,201 +5,195 @@ from src.models import ServerEphemeralKeys, ServerPersistentKeys, ClientEphemera
ClientPersistentDataKeys, ClientEphemeralDataKeys, ClientEphemeralMediumKeys, ClientPersistentMediumKeys ClientPersistentDataKeys, ClientEphemeralDataKeys, ClientEphemeralMediumKeys, ClientPersistentMediumKeys
import json import json
height = 10 height = 256
width = 7 width = 7
block_size = 10 block_size = 10
def darc_phase1(alphabet: AlphabetKey, server_keys: ServerKeys, mutual_keys: MutualKeys): def darc_phase1(alphabet: AlphabetKey, server_keys: ServerKeys, mutual_keys: MutualKeys):
alphabet_phase1 = translate_data(alphabet, server_keys.Persistent.Data, server_keys.Ephemeral.Data, mutual_keys.Persistent.Data, mutual_keys.Ephemeral.Data) alphabet_phase1 = translate_data(alphabet, server_keys.persistent.data, server_keys.ephemeral.data, mutual_keys.persistent.data, mutual_keys.ephemeral.data)
medium = translate_medium(server_keys.Persistent.Medium, server_keys.Ephemeral.Medium, mutual_keys.Persistent.Medium, mutual_keys.Ephemeral.Medium) medium = translate_medium(server_keys.persistent.medium, server_keys.ephemeral.medium, mutual_keys.persistent.medium, mutual_keys.ephemeral.medium)
return alphabet_phase1, medium return alphabet_phase1, medium
def translate_data(alphabet: AlphabetKey, server_persistent_keys: ServerPersistentDataKeys, server_ephemeral_keys: ServerEphemeralDataKeys, mutual_persistent_keys: MutualPersistentDataKeys, mutual_ephemeral_keys: MutualEphemeralDataKeys): def translate_data(alphabet: AlphabetKey, server_persistent_keys: ServerPersistentDataKeys, server_ephemeral_keys: ServerEphemeralDataKeys, mutual_persistent_keys: MutualPersistentDataKeys, mutual_ephemeral_keys: MutualEphemeralDataKeys):
function_ephemeral_key_applied = mutual_persistent_keys.Inner1 << mutual_ephemeral_keys.Inner1 mutual_inner_key = mutual_persistent_keys.inner_key_1 << mutual_ephemeral_keys.inner_key_1
outer_function_ephemeral_key_applied = mutual_persistent_keys.OuterFunctionKey << mutual_ephemeral_keys.OuterFunctionKey mutual_outer_key_1 = mutual_persistent_keys.outer_key_1 << mutual_ephemeral_keys.outer_key_1
outer_function_function_ephemeral_key_applied = mutual_persistent_keys.OuterFunctionFunctionKey << mutual_ephemeral_keys.OuterFunctionFunctionKey mutual_outer_key_2 = mutual_persistent_keys.outer_key_2 << mutual_ephemeral_keys.outer_key_2
outer_server_shuffle_ephemeral_key_applied = server_persistent_keys.OuterServerShuffleKey << server_ephemeral_keys.OuterServerShuffleEphemeralKey mutual_outer_key_3 = mutual_persistent_keys.outer_key_3 << mutual_ephemeral_keys.outer_key_3
outer_server_shuffle_function_ephemeral_key_applied = mutual_persistent_keys.OuterServerShuffleFunctionKey << mutual_ephemeral_keys.OuterServerShuffleFunctionKey
input_data = alphabet < outer_server_shuffle_ephemeral_key_applied
server_shuffle_ephemeral_key_applied = server_ephemeral_keys.ServerShuffleEphemeralKey << server_persistent_keys.ServerShuffleKey # TODO: should this be the other way around?
server_shuffle_ephemeral_key_applied = server_shuffle_ephemeral_key_applied < outer_server_shuffle_function_ephemeral_key_applied
input_data = input_data << server_shuffle_ephemeral_key_applied
# substitute_function_operands server_inner_key = server_ephemeral_keys.inner_key_1 << server_persistent_keys.inner_key_1 # TODO: should this be the other way around?
outer_function_function = outer_function_function_ephemeral_key_applied server_inner_key = server_inner_key < mutual_outer_key_3
inner_function = function_ephemeral_key_applied server_outer_key_1 = server_persistent_keys.outer_key_1 << server_ephemeral_keys.outer_key_1
outer_function = outer_function_ephemeral_key_applied
operand = input_data
operand1 = server_persistent_keys.ServerKey < outer_function
operand2 = server_ephemeral_keys.ServerEphemeralKey < outer_function
inner_function_shuffled = inner_function < outer_function_function input_data = alphabet < server_outer_key_1
operand = operand ^ (operand1 << inner_function_shuffled) ^ (operand2 << inner_function_shuffled) input_data = input_data << server_inner_key
return operand
operand1 = server_persistent_keys.alpha_key_1 < mutual_outer_key_1
operand2 = server_ephemeral_keys.alpha_key_1 < mutual_outer_key_1
mutual_inner_key = mutual_inner_key < mutual_outer_key_2
solution = (operand1 << mutual_inner_key) ^ (operand2 << mutual_inner_key)
alpha_phase1 = input_data ^ solution
return alpha_phase1
def translate_medium(server_persistent_keys: ServerPersistentMediumKeys, server_ephemeral_keys: ServerEphemeralMediumKeys, mutual_persistent_keys: MutualPersistentMediumKeys, mutual_ephemeral_keys: MutualEphemeralMediumKeys): def translate_medium(server_persistent_keys: ServerPersistentMediumKeys, server_ephemeral_keys: ServerEphemeralMediumKeys, mutual_persistent_keys: MutualPersistentMediumKeys, mutual_ephemeral_keys: MutualEphemeralMediumKeys):
function_ephemeral_key_applied = mutual_persistent_keys.FunctionMediumKey << mutual_ephemeral_keys.FunctionMediumKey mutual_inner_key = mutual_persistent_keys.inner_key_1 << mutual_ephemeral_keys.inner_key_1
outer_function_ephemeral_key_applied = mutual_persistent_keys.OuterFunctionMediumKey << mutual_ephemeral_keys.OuterFunctionMediumEphemeralKey mutual_outer_key_1 = mutual_persistent_keys.outer_key_1 << mutual_ephemeral_keys.outer_key_1
outer_function_function_ephemeral_key_applied = mutual_persistent_keys.OuterFunctionFunctionMediumKey << mutual_ephemeral_keys.OuterFunctionFunctionMediumEphemeralKey mutual_outer_key_2 = mutual_persistent_keys.outer_key_2 << mutual_ephemeral_keys.outer_key_2
input_data = AlphabetKey(matrix=[[0 for _ in range(width)] for _ in range(height)]) medium = AlphabetKey(matrix=[[0 for _ in range(width)] for _ in range(height)])
# substitute_function_operands operand1 = server_persistent_keys.alpha_key_1 < mutual_outer_key_1
outer_function_function = outer_function_function_ephemeral_key_applied operand2 = server_ephemeral_keys.alpha_key_1 < mutual_outer_key_1
inner_function = function_ephemeral_key_applied
outer_function = outer_function_ephemeral_key_applied
operand = input_data
operand1 = server_persistent_keys.ServerMediumKey < outer_function
operand2 = server_ephemeral_keys.ServerMediumEphemeralKey < outer_function
inner_function_shuffled = inner_function < outer_function_function mutual_inner_key = mutual_inner_key < mutual_outer_key_2
operand = operand ^ (operand1 << inner_function_shuffled) ^ (operand2 << inner_function_shuffled) operand = medium ^ (operand1 << mutual_inner_key) ^ (operand2 << mutual_inner_key)
return operand return operand
def darc_phase2(alphabet: AlphabetKey, medium: AlphabetKey, client_keys: ClientKeys, mutual_keys: MutualKeys): def darc_phase2(alphabet: AlphabetKey, medium: AlphabetKey, client_keys: ClientKeys, mutual_keys: MutualKeys):
alphabet_phase2 = receive_alphabet(alphabet, client_keys.Persistent.Data, client_keys.Ephemeral.Data, mutual_keys.Persistent.Data , mutual_keys.Ephemeral.Data) alphabet_phase2 = receive_alphabet(alphabet, client_keys.persistent.data, client_keys.ephemeral.data, mutual_keys.persistent.data, mutual_keys.ephemeral.data)
medium = receive_medium(medium, client_keys.Persistent.Medium, client_keys.Ephemeral.Medium, mutual_keys.Persistent.Medium, mutual_keys.Ephemeral.Medium) medium = receive_medium(medium, client_keys.persistent.medium, client_keys.ephemeral.medium, mutual_keys.persistent.medium, mutual_keys.ephemeral.medium)
return alphabet_phase2, medium return alphabet_phase2, medium
def receive_alphabet(alphabet: AlphabetKey, client_persistent_keys: ClientPersistentDataKeys, client_ephemeral_keys: ClientEphemeralDataKeys, mutual_persistent_keys: MutualPersistentDataKeys, mutual_ephemeral_keys: MutualEphemeralDataKeys): def receive_alphabet(alphabet: AlphabetKey, client_persistent_keys: ClientPersistentDataKeys, client_ephemeral_keys: ClientEphemeralDataKeys, mutual_persistent_keys: MutualPersistentDataKeys, mutual_ephemeral_keys: MutualEphemeralDataKeys):
function_key_applied = mutual_persistent_keys.Inner1 << mutual_ephemeral_keys.Inner1 mutual_inner_key = mutual_persistent_keys.inner_key_1 << mutual_ephemeral_keys.inner_key_1
outer_function_key_applied = mutual_persistent_keys.OuterFunctionKey << mutual_ephemeral_keys.OuterFunctionKey mutual_outer_key_1 = mutual_persistent_keys.outer_key_1 << mutual_ephemeral_keys.outer_key_1
outer_function_function_key_applied = mutual_persistent_keys.OuterFunctionFunctionKey << mutual_ephemeral_keys.OuterFunctionFunctionKey mutual_outer_key_2 = mutual_persistent_keys.outer_key_2 << mutual_ephemeral_keys.outer_key_2
mutual_outer_key_3 = mutual_persistent_keys.outer_key_3 << mutual_ephemeral_keys.outer_key_3
inner_function_key_applied = function_key_applied < outer_function_function_key_applied operand1 = client_ephemeral_keys.alpha_key_1 < mutual_outer_key_1
operand = alphabet operand2 = client_persistent_keys.alpha_key_1 < mutual_outer_key_1
operand1 = client_ephemeral_keys.ClientEphemeralKey < outer_function_key_applied operand3 = mutual_persistent_keys.alpha_key_1 < mutual_outer_key_1
operand2 = client_persistent_keys.ClientKey < outer_function_key_applied
operand3 = mutual_persistent_keys.MutualKey < outer_function_key_applied
result = operand ^ (operand1 << inner_function_key_applied) ^ (operand2 << inner_function_key_applied) ^ (operand3 << inner_function_key_applied) mutual_inner_key = mutual_inner_key < mutual_outer_key_2
outer_server_shuffle_function_key_applied = mutual_persistent_keys.OuterServerShuffleFunctionKey << mutual_ephemeral_keys.OuterServerShuffleFunctionKey result = alphabet ^ (operand1 << mutual_inner_key) ^ (operand2 << mutual_inner_key) ^ (operand3 << mutual_inner_key)
client_shuffle_key_a_applied = client_persistent_keys.ClientShuffleKeyA << client_ephemeral_keys.ClientShuffleEphemeralKeyA
result = result << (client_shuffle_key_a_applied < outer_server_shuffle_function_key_applied) client_inner_key = client_persistent_keys.inner_key_1 << client_ephemeral_keys.inner_key_1
client_inner_key = client_inner_key < mutual_outer_key_3
result = result << client_inner_key
client_outer_key_1 = client_persistent_keys.outer_key_1 << client_ephemeral_keys.outer_key_1
client_outer_key_2 = client_persistent_keys.outer_key_2 << client_ephemeral_keys.outer_key_2
result = result < (client_outer_key_1 << client_outer_key_2)
outer_client_shuffle_key_applied = client_persistent_keys.OuterClientShuffleKey << client_ephemeral_keys.OuterClientShuffleEphemeralKey
outer_client_shuffle_function_key_applied = client_persistent_keys.OuterClientShuffleFunctionKey << client_ephemeral_keys.OuterClientShuffleFunctionEphemeralKey
outer_client_shuffle_key_applied = outer_client_shuffle_key_applied << outer_client_shuffle_function_key_applied
result = result < outer_client_shuffle_key_applied
return result return result
def receive_medium(medium: AlphabetKey, client_persistent_keys: ClientPersistentMediumKeys, client_ephemeral_keys: ClientEphemeralMediumKeys, mutual_persistent_keys: MutualPersistentMediumKeys, mutual_ephemeral_keys: MutualEphemeralMediumKeys): def receive_medium(medium: AlphabetKey, client_persistent_keys: ClientPersistentMediumKeys, client_ephemeral_keys: ClientEphemeralMediumKeys, mutual_persistent_keys: MutualPersistentMediumKeys, mutual_ephemeral_keys: MutualEphemeralMediumKeys):
function_key_applied = mutual_persistent_keys.FunctionMediumKey << mutual_ephemeral_keys.FunctionMediumKey mutual_inner_key = mutual_persistent_keys.inner_key_1 << mutual_ephemeral_keys.inner_key_1
outer_function_key_applied = mutual_persistent_keys.OuterFunctionMediumKey << mutual_ephemeral_keys.OuterFunctionMediumEphemeralKey mutual_outer_key_1 = mutual_persistent_keys.outer_key_1 << mutual_ephemeral_keys.outer_key_1
outer_function_function_key_applied = mutual_persistent_keys.OuterFunctionFunctionMediumKey << mutual_ephemeral_keys.OuterFunctionFunctionMediumEphemeralKey mutual_outer_key_2 = mutual_persistent_keys.outer_key_2 << mutual_ephemeral_keys.outer_key_2
mutual_outer_key_3 = mutual_persistent_keys.outer_key_3 << mutual_ephemeral_keys.outer_key_3
inner_function_key_applied = function_key_applied < outer_function_function_key_applied mutual_inner_key = mutual_inner_key < mutual_outer_key_2
operand = medium
operand1 = client_ephemeral_keys.ClientMediumEphemeralKey < outer_function_key_applied
operand2 = client_persistent_keys.ClientMediumKey < outer_function_key_applied
operand3 = mutual_persistent_keys.MutualMediumKey < outer_function_key_applied
result = operand ^ (operand1 << inner_function_key_applied) ^ (operand2 << inner_function_key_applied) ^ (operand3 << inner_function_key_applied) operand1 = client_ephemeral_keys.alpha_key_1 < mutual_outer_key_1
operand2 = client_persistent_keys.alpha_key_1 < mutual_outer_key_1
operand3 = mutual_persistent_keys.alpha_key_1 < mutual_outer_key_1
client_shuffle_key_a_applied = client_persistent_keys.ClientShuffleMediumKeyA << client_ephemeral_keys.ClientShuffleMediumEphemeralKeyA result = medium ^ (operand1 << mutual_inner_key) ^ (operand2 << mutual_inner_key) ^ (operand3 << mutual_inner_key)
outer_server_shuffle_function_key_applied = mutual_persistent_keys.OuterServerShuffleFunctionMediumKey << mutual_ephemeral_keys.OuterServerShuffleFunctionMediumEphemeralKey
client_shuffle_key_a_applied = client_shuffle_key_a_applied < outer_server_shuffle_function_key_applied
result = result << client_shuffle_key_a_applied
outer_client_shuffle_key_applied = client_persistent_keys.OuterClientShuffleMediumKey << client_ephemeral_keys.OuterClientShuffleMediumEphemeralKey client_inner_key = client_persistent_keys.inner_key_1 << client_ephemeral_keys.inner_key_1
outer_client_shuffle_function_key_applied = client_persistent_keys.OuterClientShuffleFunctionMediumKey << client_ephemeral_keys.OuterClientShuffleFunctionMediumEphemeralKey client_inner_key = client_inner_key < mutual_outer_key_3
outer_client_shuffle_key_applied = outer_client_shuffle_key_applied << outer_client_shuffle_function_key_applied result = result << client_inner_key
result = result < outer_client_shuffle_key_applied
client_outer_key_1 = client_persistent_keys.outer_key_1 << client_ephemeral_keys.outer_key_1
client_outer_key2 = client_persistent_keys.outer_key_2 << client_ephemeral_keys.outer_key_2
client_outer_key_1 = client_outer_key_1 << client_outer_key2
result = result < client_outer_key_1
return result return result
def darc_phase3(alphabet: AlphabetKey, medium: AlphabetKey, client_keys: ClientKeys, mutual_keys: MutualKeys): def darc_phase3(alphabet: AlphabetKey, medium: AlphabetKey, client_keys: ClientKeys, mutual_keys: MutualKeys):
alphabet_phase3 = transmit_alphabet(alphabet, client_keys.Persistent.Data, client_keys.Ephemeral.Data, mutual_keys.Persistent.Data, mutual_keys.Ephemeral.Data) alphabet_phase3 = transmit_alphabet(alphabet, client_keys.persistent.data, client_keys.ephemeral.data, mutual_keys.persistent.data, mutual_keys.ephemeral.data)
medium = transmit_medium(medium, client_keys.Persistent.Medium, client_keys.Ephemeral.Medium, mutual_keys.Persistent.Medium, mutual_keys.Ephemeral.Medium) medium = transmit_medium(medium, client_keys.persistent.medium, client_keys.ephemeral.medium, mutual_keys.persistent.medium, mutual_keys.ephemeral.medium)
return alphabet_phase3, medium return alphabet_phase3, medium
def transmit_alphabet(alphabet: DarcKey, client_persistent_keys: ClientPersistentDataKeys, client_ephemeral_keys: ClientEphemeralDataKeys, mutual_persistent_keys: MutualPersistentDataKeys, mutual_ephemeral_keys: MutualEphemeralDataKeys): def transmit_alphabet(alphabet: DarcKey, client_persistent_keys: ClientPersistentDataKeys, client_ephemeral_keys: ClientEphemeralDataKeys, mutual_persistent_keys: MutualPersistentDataKeys, mutual_ephemeral_keys: MutualEphemeralDataKeys):
outer_server_shuffle_function_key_applied = mutual_persistent_keys.OuterServerShuffleFunctionKey << mutual_ephemeral_keys.OuterServerShuffleFunctionKey mutual_outer_key_2 = mutual_persistent_keys.outer_key_2 << mutual_ephemeral_keys.outer_key_2
outer_client_shuffle_key_applied = client_persistent_keys.OuterClientShuffleKey << client_ephemeral_keys.OuterClientShuffleEphemeralKey mutual_outer_key_3 = mutual_persistent_keys.outer_key_3 << mutual_ephemeral_keys.outer_key_3
outer_client_shuffle_function_key_applied = client_persistent_keys.OuterClientShuffleFunctionKey << client_ephemeral_keys.OuterClientShuffleFunctionEphemeralKey
input_outer_client_shuffle_key = outer_client_shuffle_key_applied << outer_client_shuffle_function_key_applied client_outer_key_1 = client_persistent_keys.outer_key_1 << client_ephemeral_keys.outer_key_1
input_outer_server_shuffle_function_key = outer_server_shuffle_function_key_applied << input_outer_client_shuffle_key client_outer_key_2 = client_persistent_keys.outer_key_2 << client_ephemeral_keys.outer_key_2
outer_function_function_key_applied = mutual_persistent_keys.OuterFunctionFunctionKey << mutual_ephemeral_keys.OuterFunctionFunctionKey
outer_function_function_key_applied = outer_function_function_key_applied << input_outer_client_shuffle_key
function_key_applied = mutual_persistent_keys.Inner1 << mutual_ephemeral_keys.Inner1 client_outer_key = client_outer_key_1 << client_outer_key_2
function_key_applied = function_key_applied < outer_function_function_key_applied
reordered_shuffle_key_x = mutual_persistent_keys.ClientShuffleKeyX < input_outer_server_shuffle_function_key mutual_outer_key_3 = mutual_outer_key_3 << client_outer_key
mutual_outer_key_2 = mutual_outer_key_2 << client_outer_key
function_ephemeral_key_applied = function_key_applied << reordered_shuffle_key_x mutual_inner_key_1 = mutual_persistent_keys.inner_key_1 << mutual_ephemeral_keys.inner_key_1
mutual_inner_key_1 = mutual_inner_key_1 < mutual_outer_key_2
client_shuffle_key_b = (~client_persistent_keys.ClientShuffleKeyA) << mutual_persistent_keys.ClientShuffleKeyX mutual_inner_key_2 = mutual_persistent_keys.inner_key_2 < mutual_outer_key_3
client_shuffle_ephemeral_key_b = ~client_ephemeral_keys.ClientShuffleEphemeralKeyA
input_client_shuffle_key_b = client_shuffle_ephemeral_key_b << client_shuffle_key_b
input_client_shuffle_key_b = input_client_shuffle_key_b < input_outer_server_shuffle_function_key
shuffled_items = alphabet << input_client_shuffle_key_b
outer_function_key_applied = mutual_persistent_keys.OuterFunctionKey << mutual_ephemeral_keys.OuterFunctionKey mutual_inner_key = mutual_inner_key_1 << mutual_inner_key_2
input_outer_function_key = outer_function_key_applied << input_outer_client_shuffle_key
inner_function_key_applied = function_ephemeral_key_applied inner_key_1 = ~client_persistent_keys.inner_key_1 << mutual_persistent_keys.inner_key_2
operand = shuffled_items inner_key_2 = ~client_ephemeral_keys.inner_key_1
operand1 = client_ephemeral_keys.ClientEphemeralKey < input_outer_function_key inner_key_3 = inner_key_2 << inner_key_1
operand2 = client_persistent_keys.ClientKey < input_outer_function_key inner_key_3 = inner_key_3 < mutual_outer_key_3
operand3 = mutual_ephemeral_keys.MutualKey < input_outer_function_key result = alphabet << inner_key_3
result = operand ^ (operand1 << inner_function_key_applied) ^ (operand2 << inner_function_key_applied) ^ (operand3 << inner_function_key_applied) mutual_outer_key_1 = mutual_persistent_keys.outer_key_1 << mutual_ephemeral_keys.outer_key_1
outer_key_1 = mutual_outer_key_1 << client_outer_key
operand1 = client_ephemeral_keys.alpha_key_1 < outer_key_1
operand2 = client_persistent_keys.alpha_key_1 < outer_key_1
operand3 = mutual_ephemeral_keys.alpha_key_1 < outer_key_1
result = result ^ (operand1 << mutual_inner_key) ^ (operand2 << mutual_inner_key) ^ (operand3 << mutual_inner_key)
return result return result
def transmit_medium(medium: DarcKey, client_persistent_keys: ClientPersistentMediumKeys, client_ephemeral_keys: ClientEphemeralMediumKeys, mutual_persistent_keys: MutualPersistentMediumKeys, mutual_ephemeral_keys: MutualEphemeralMediumKeys): def transmit_medium(medium: DarcKey, client_persistent_keys: ClientPersistentMediumKeys, client_ephemeral_keys: ClientEphemeralMediumKeys, mutual_persistent_keys: MutualPersistentMediumKeys, mutual_ephemeral_keys: MutualEphemeralMediumKeys):
client_shuffle_ephemeral_key_b = ~client_ephemeral_keys.ClientShuffleMediumEphemeralKeyA client_inner_key_1 = ~client_ephemeral_keys.inner_key_1
outer_server_shuffle_function_key_applied = mutual_persistent_keys.OuterServerShuffleFunctionMediumKey << mutual_ephemeral_keys.OuterServerShuffleFunctionMediumEphemeralKey mutual_outer_key_3 = mutual_persistent_keys.outer_key_3 << mutual_ephemeral_keys.outer_key_3
outer_client_shuffle_key_applied = client_persistent_keys.OuterClientShuffleMediumKey << client_ephemeral_keys.OuterClientShuffleMediumEphemeralKey client_outer_key_1 = client_persistent_keys.outer_key_1 << client_ephemeral_keys.outer_key_1
outer_client_suffle_function_key_applied = client_persistent_keys.OuterClientShuffleFunctionMediumKey << client_ephemeral_keys.OuterClientShuffleFunctionMediumEphemeralKey client_outer_key_2 = client_persistent_keys.outer_key_2 << client_ephemeral_keys.outer_key_2
input_outer_client_shuffle_key = outer_client_shuffle_key_applied << outer_client_suffle_function_key_applied outer_key_1 = client_outer_key_1 << client_outer_key_2
input_outer_server_shuffle_function_key = outer_server_shuffle_function_key_applied << input_outer_client_shuffle_key outer_key_2 = mutual_outer_key_3 << outer_key_1
outer_function_function_key_applied = mutual_persistent_keys.OuterFunctionFunctionMediumKey << mutual_ephemeral_keys.OuterFunctionFunctionMediumEphemeralKey mutual_outer_key_2 = mutual_persistent_keys.outer_key_2 << mutual_ephemeral_keys.outer_key_2
outer_function_function_key_applied = outer_function_function_key_applied << input_outer_client_shuffle_key outer_key_3 = mutual_outer_key_2 << outer_key_1
function_key_applied = mutual_persistent_keys.FunctionMediumKey << mutual_ephemeral_keys.FunctionMediumKey mutual_inner_key_1 = mutual_persistent_keys.inner_key_1 << mutual_ephemeral_keys.inner_key_1
function_key_applied = function_key_applied < outer_function_function_key_applied mutual_inner_key_1 = mutual_inner_key_1 < outer_key_3
reordered_shuffle_key_x = mutual_persistent_keys.ClientShuffleMediumKeyX < input_outer_server_shuffle_function_key mutual_inner_key_2 = mutual_persistent_keys.inner_key_2 < outer_key_2
function_ephemeral_key_applied = function_key_applied << reordered_shuffle_key_x inner_key_1 = mutual_inner_key_1 << mutual_inner_key_2
client_shuffle_key_b = (~client_persistent_keys.ClientShuffleMediumKeyA) << mutual_persistent_keys.ClientShuffleMediumKeyX client_shuffle_key_b = (~client_persistent_keys.inner_key_1) << mutual_persistent_keys.inner_key_2
input_client_shuffle_key_b = client_shuffle_ephemeral_key_b << client_shuffle_key_b input_client_shuffle_key_b = client_inner_key_1 << client_shuffle_key_b
input_client_shuffle_key_b = input_client_shuffle_key_b < input_outer_server_shuffle_function_key input_client_shuffle_key_b = input_client_shuffle_key_b < outer_key_2
shuffled_items = medium << input_client_shuffle_key_b shuffled_items = medium << input_client_shuffle_key_b
outer_function_key_applied = mutual_persistent_keys.OuterFunctionMediumKey << mutual_ephemeral_keys.OuterFunctionMediumEphemeralKey outer_function_key_applied = mutual_persistent_keys.outer_key_1 << mutual_ephemeral_keys.outer_key_1
input_outer_function_key = outer_function_key_applied << input_outer_client_shuffle_key input_outer_function_key = outer_function_key_applied << outer_key_1
inner_function_key_applied = function_ephemeral_key_applied inner_function_key_applied = inner_key_1
operand = shuffled_items operand = shuffled_items
operand1 = client_ephemeral_keys.ClientMediumEphemeralKey < input_outer_function_key operand1 = client_ephemeral_keys.alpha_key_1 < input_outer_function_key
operand2 = client_persistent_keys.ClientMediumKey < input_outer_function_key operand2 = client_persistent_keys.alpha_key_1 < input_outer_function_key
operand3 = mutual_ephemeral_keys.MutualMediumKey < input_outer_function_key operand3 = mutual_ephemeral_keys.alpha_key_1 < input_outer_function_key
result = operand ^ (operand1 << inner_function_key_applied) ^ (operand2 << inner_function_key_applied) ^ (operand3 << inner_function_key_applied) result = operand ^ (operand1 << inner_function_key_applied) ^ (operand2 << inner_function_key_applied) ^ (operand3 << inner_function_key_applied)
return result return result
def merge_message(alphabet: DarcKey, medium: DarcKey, client_keys: ClientKeys, mutual_keys: MutualKeys, input_sequence: list[int]): def merge_message(alphabet: DarcKey, medium: DarcKey, client_keys: ClientKeys, mutual_keys: MutualKeys, input_sequence: list[int]):
outer_client_shuffle_alphabet_key_applied = client_keys.Persistent.Data.OuterClientShuffleKey << client_keys.Ephemeral.Data.OuterClientShuffleEphemeralKey client_outer_key_1 = client_keys.persistent.data.outer_key_1 << client_keys.ephemeral.data.outer_key_1
outer_client_shuffle_function_alphabet_key_applied = client_keys.Persistent.Data.OuterClientShuffleFunctionKey << client_keys.Ephemeral.Data.OuterClientShuffleFunctionEphemeralKey client_outer_key_2 = client_keys.persistent.data.outer_key_2 << client_keys.ephemeral.data.outer_key_2
outer_client_shuffle_alphabet_key_applied = ~(outer_client_shuffle_alphabet_key_applied << outer_client_shuffle_function_alphabet_key_applied) client_outer_key_1 = ~(client_outer_key_1 << client_outer_key_2)
msg_len = len(input_sequence) msg_len = len(input_sequence)
eof_arr = AlphabetKey.init_matrix(width, height, 255).matrix[0] eof_arr = AlphabetKey.init_matrix(width, height, 255).matrix[0]
@@ -210,109 +204,106 @@ def merge_message(alphabet: DarcKey, medium: DarcKey, client_keys: ClientKeys, m
else: else:
padded_input_sequence = OuterShuffleKey(matrix=[input_sequence]) padded_input_sequence = OuterShuffleKey(matrix=[input_sequence])
input_sequence_applied = outer_client_shuffle_alphabet_key_applied << padded_input_sequence client_outer_key_1 = client_outer_key_1 << padded_input_sequence
outer_client_shuffle_medium_key_applied = client_keys.Persistent.Medium.OuterClientShuffleMediumKey << client_keys.Ephemeral.Medium.OuterClientShuffleMediumEphemeralKey client_med_outer_key_1 = client_keys.persistent.medium.outer_key_1 << client_keys.ephemeral.medium.outer_key_1
outer_client_shuffle_function_medium_key_applied = client_keys.Persistent.Medium.OuterClientShuffleFunctionMediumKey << client_keys.Ephemeral.Medium.OuterClientShuffleFunctionMediumEphemeralKey client_med_outer_key_2 = client_keys.persistent.medium.outer_key_2 << client_keys.ephemeral.medium.outer_key_2
outer_client_shuffle_medium_key_applied = outer_client_shuffle_medium_key_applied << outer_client_shuffle_function_medium_key_applied client_med_outer_key_1 = client_med_outer_key_1 << client_med_outer_key_2
input_sequence_applied = input_sequence_applied << outer_client_shuffle_medium_key_applied client_outer_key_1 = client_outer_key_1 << client_med_outer_key_1
message = alphabet < input_sequence_applied message = alphabet < client_outer_key_1
message_pad_key = ~outer_client_shuffle_medium_key_applied message_pad_key = ~client_med_outer_key_1
if msg_len < height: if msg_len < height:
message.matrix[message_pad_key.matrix[0][msg_len]] = eof_arr message.matrix[message_pad_key.matrix[0][msg_len]] = eof_arr
position_function_key_applied = mutual_keys.Persistent.Medium.PositionFunctionMediumKey << mutual_keys.Ephemeral.Medium.PositionFunctionMediumEphemeralKey mutual_inner_key_3 = mutual_keys.persistent.medium.inner_key_3 << mutual_keys.ephemeral.medium.inner_key_3
outer_position_function_key_applied = mutual_keys.Persistent.Medium.OuterPositionFunctionMediumKey << mutual_keys.Ephemeral.Medium.OuterPositionFunctionMediumEphemeralKey mutual_outer_key_6 = mutual_keys.persistent.medium.outer_key_6 << mutual_keys.ephemeral.medium.outer_key_6
outer_position_shuffle_key_applied = mutual_keys.Persistent.Medium.OuterPositionShuffleMediumKey << mutual_keys.Ephemeral.Medium.OuterPositionShuffleMediumEphemeralKey mutual_outer_key_4 = mutual_keys.persistent.medium.outer_key_4 << mutual_keys.ephemeral.medium.outer_key_4
outer_position_function_key_applied = outer_position_shuffle_key_applied << outer_position_function_key_applied outer_key_1 = mutual_outer_key_4 << mutual_outer_key_6
outer_client_shuffle_medium_key_applied = ~outer_client_shuffle_medium_key_applied client_med_outer_key_1 = ~client_med_outer_key_1
outer_position_function_key_applied = ~(outer_client_shuffle_medium_key_applied << outer_position_function_key_applied) outer_key_1 = ~(client_med_outer_key_1 << outer_key_1)
inner_function_key_applied = position_function_key_applied < outer_position_function_key_applied mutual_inner_key_3 = mutual_inner_key_3 < outer_key_1
operand = medium message = medium ^ (message << mutual_inner_key_3)
operand1 = message
message = operand ^ (operand1 << inner_function_key_applied) mutual_outer_key_5 = mutual_keys.persistent.medium.outer_key_5 << mutual_keys.ephemeral.medium.outer_key_5
mutual_inner_key = mutual_keys.persistent.medium.inner_key_4 << mutual_keys.ephemeral.medium.inner_key_2
outer_position_shuffle_function_key_applied = mutual_keys.Persistent.Medium.OuterPositionShuffleFunctionMediumKey << mutual_keys.Ephemeral.Medium.OuterPositionShuffleFunctionMediumEphemeralKey mutual_outer_key_4 = client_med_outer_key_1 << mutual_outer_key_4
position_shuffle_key_applied = mutual_keys.Persistent.Medium.PositionShuffleMediumKey << mutual_keys.Ephemeral.Medium.PositionShuffleMediumEphemeralKey outer_key_2 = mutual_outer_key_5 << outer_key_1
outer_position_shuffle_key_applied = outer_client_shuffle_medium_key_applied << outer_position_shuffle_key_applied message = message << (mutual_inner_key < outer_key_2)
outer_position_shuffle_function_key_applied = outer_position_shuffle_function_key_applied << outer_position_function_key_applied message = message < mutual_outer_key_4
message = message << (position_shuffle_key_applied < outer_position_shuffle_function_key_applied)
message = message < outer_position_shuffle_key_applied
return message return message
def darc_phase_4(alphabet: AlphabetKey, darc_message: AlphabetKey, server_keys: ServerKeys, mutual_keys: MutualKeys): def darc_phase_4(alphabet: AlphabetKey, darc_message: AlphabetKey, server_keys: ServerKeys, mutual_keys: MutualKeys):
outer_position_function_ephemeral_key_applied = mutual_keys.Persistent.Medium.OuterPositionFunctionMediumKey << mutual_keys.Ephemeral.Medium.OuterPositionFunctionMediumEphemeralKey outer_position_function_ephemeral_key_applied = mutual_keys.persistent.medium.outer_key_6 << mutual_keys.ephemeral.medium.outer_key_6
outer_position_shuffle_ephemeral_key_applied = mutual_keys.Persistent.Medium.OuterPositionShuffleMediumKey << mutual_keys.Ephemeral.Medium.OuterPositionShuffleMediumEphemeralKey outer_position_shuffle_ephemeral_key_applied = mutual_keys.persistent.medium.outer_key_4 << mutual_keys.ephemeral.medium.outer_key_4
outer_position_function_ephemeral_key_applied = ~(outer_position_shuffle_ephemeral_key_applied << outer_position_function_ephemeral_key_applied) outer_position_function_ephemeral_key_applied = ~(outer_position_shuffle_ephemeral_key_applied << outer_position_function_ephemeral_key_applied)
outer_position_shuffle_ephemeral_key_applied = ~outer_position_shuffle_ephemeral_key_applied outer_position_shuffle_ephemeral_key_applied = ~outer_position_shuffle_ephemeral_key_applied
outer_position_shuffle_function_ephemeral_key_applied = mutual_keys.Persistent.Medium.OuterPositionShuffleFunctionMediumKey << mutual_keys.Ephemeral.Medium.OuterPositionShuffleFunctionMediumEphemeralKey outer_position_shuffle_function_ephemeral_key_applied = mutual_keys.persistent.medium.outer_key_5 << mutual_keys.ephemeral.medium.outer_key_5
outer_position_shuffle_function_ephemeral_key_applied = outer_position_shuffle_function_ephemeral_key_applied << outer_position_function_ephemeral_key_applied outer_position_shuffle_function_ephemeral_key_applied = outer_position_shuffle_function_ephemeral_key_applied << outer_position_function_ephemeral_key_applied
outer_function_function_medium_ephemeral_key_applied = mutual_keys.Persistent.Medium.OuterFunctionFunctionMediumKey << mutual_keys.Ephemeral.Medium.OuterFunctionFunctionMediumEphemeralKey outer_function_function_medium_ephemeral_key_applied = mutual_keys.persistent.medium.outer_key_2 << mutual_keys.ephemeral.medium.outer_key_2
outer_server_shuffle_function_ephemeral_key_applied = mutual_keys.Persistent.Data.OuterServerShuffleFunctionKey << mutual_keys.Ephemeral.Data.OuterServerShuffleFunctionKey outer_server_shuffle_function_ephemeral_key_applied = mutual_keys.persistent.data.outer_key_3 << mutual_keys.ephemeral.data.outer_key_3
outer_server_shuffle_function_medium_ephemeral_key_applied = mutual_keys.Persistent.Medium.OuterServerShuffleFunctionMediumKey << mutual_keys.Ephemeral.Medium.OuterServerShuffleFunctionMediumEphemeralKey outer_server_shuffle_function_medium_ephemeral_key_applied = mutual_keys.persistent.medium.outer_key_3 << mutual_keys.ephemeral.medium.outer_key_3
function_medium_ephemeral_key_applied = mutual_keys.Persistent.Medium.FunctionMediumKey << mutual_keys.Ephemeral.Medium.FunctionMediumKey function_medium_ephemeral_key_applied = mutual_keys.persistent.medium.inner_key_1 << mutual_keys.ephemeral.medium.inner_key_1
client_shuffle_medium_key_x = mutual_keys.Persistent.Medium.ClientShuffleMediumKeyX < outer_server_shuffle_function_medium_ephemeral_key_applied client_shuffle_medium_key_x = mutual_keys.persistent.medium.inner_key_2 < outer_server_shuffle_function_medium_ephemeral_key_applied
client_shuffle_medium_key_x = (function_medium_ephemeral_key_applied < outer_function_function_medium_ephemeral_key_applied) << client_shuffle_medium_key_x client_shuffle_medium_key_x = (function_medium_ephemeral_key_applied < outer_function_function_medium_ephemeral_key_applied) << client_shuffle_medium_key_x
position_shuffle_ephemeral_key_applied = mutual_keys.Persistent.Medium.PositionShuffleMediumKey << mutual_keys.Ephemeral.Medium.PositionShuffleMediumEphemeralKey position_shuffle_ephemeral_key_applied = mutual_keys.persistent.medium.inner_key_4 << mutual_keys.ephemeral.medium.inner_key_2
position_shuffle_ephemeral_key_applied = position_shuffle_ephemeral_key_applied < outer_position_shuffle_function_ephemeral_key_applied position_shuffle_ephemeral_key_applied = position_shuffle_ephemeral_key_applied < outer_position_shuffle_function_ephemeral_key_applied
client_shuffle_medium_key_x = client_shuffle_medium_key_x << position_shuffle_ephemeral_key_applied client_shuffle_medium_key_x = client_shuffle_medium_key_x << position_shuffle_ephemeral_key_applied
outer_function_medium_ephemeral_key_applied = mutual_keys.Persistent.Medium.OuterFunctionMediumKey << mutual_keys.Ephemeral.Medium.OuterFunctionMediumEphemeralKey outer_function_medium_ephemeral_key_applied = mutual_keys.persistent.medium.outer_key_1 << mutual_keys.ephemeral.medium.outer_key_1
rx_data = darc_message < outer_position_shuffle_ephemeral_key_applied rx_data = darc_message < outer_position_shuffle_ephemeral_key_applied
inner_key = client_shuffle_medium_key_x inner_key = client_shuffle_medium_key_x
operand = rx_data operand = rx_data
operand1 = server_keys.Persistent.Medium.ServerMediumKey < outer_function_medium_ephemeral_key_applied operand1 = server_keys.persistent.medium.alpha_key_1 < outer_function_medium_ephemeral_key_applied
operand2 = server_keys.Ephemeral.Medium.ServerMediumEphemeralKey < outer_function_medium_ephemeral_key_applied operand2 = server_keys.ephemeral.medium.alpha_key_1 < outer_function_medium_ephemeral_key_applied
operand3 = mutual_keys.Persistent.Medium.MutualMediumKey < outer_function_medium_ephemeral_key_applied operand3 = mutual_keys.persistent.medium.alpha_key_1 < outer_function_medium_ephemeral_key_applied
operand4 = mutual_keys.Ephemeral.Medium.MutualMediumKey < outer_function_medium_ephemeral_key_applied operand4 = mutual_keys.ephemeral.medium.alpha_key_1 < outer_function_medium_ephemeral_key_applied
rx_data = operand ^ (operand1 << inner_key) ^ (operand2 << inner_key) ^ (operand3 << inner_key) ^ (operand4 << inner_key) rx_data = operand ^ (operand1 << inner_key) ^ (operand2 << inner_key) ^ (operand3 << inner_key) ^ (operand4 << inner_key)
position_function_ephemeral_key_applied = mutual_keys.Persistent.Medium.PositionFunctionMediumKey << mutual_keys.Ephemeral.Medium.PositionFunctionMediumEphemeralKey position_function_ephemeral_key_applied = mutual_keys.persistent.medium.inner_key_3 << mutual_keys.ephemeral.medium.inner_key_3
rx_data = rx_data << (~(position_shuffle_ephemeral_key_applied) << (~position_function_ephemeral_key_applied < outer_position_function_ephemeral_key_applied)) rx_data = rx_data << (~(position_shuffle_ephemeral_key_applied) << (~position_function_ephemeral_key_applied < outer_position_function_ephemeral_key_applied))
client_shuffle_key_x = mutual_keys.Persistent.Data.ClientShuffleKeyX < outer_server_shuffle_function_ephemeral_key_applied client_shuffle_key_x = mutual_keys.persistent.data.inner_key_2 < outer_server_shuffle_function_ephemeral_key_applied
outer_function_function_ephemeral_key_applied = mutual_keys.Persistent.Data.OuterFunctionFunctionKey << mutual_keys.Ephemeral.Data.OuterFunctionFunctionKey outer_function_function_ephemeral_key_applied = mutual_keys.persistent.data.outer_key_2 << mutual_keys.ephemeral.data.outer_key_2
function_ephemeral_key_applied = mutual_keys.Persistent.Data.Inner1 << mutual_keys.Ephemeral.Data.Inner1 function_ephemeral_key_applied = mutual_keys.persistent.data.inner_key_1 << mutual_keys.ephemeral.data.inner_key_1
function_ephemeral_key_applied = (function_ephemeral_key_applied < outer_function_function_ephemeral_key_applied) << client_shuffle_key_x function_ephemeral_key_applied = (function_ephemeral_key_applied < outer_function_function_ephemeral_key_applied) << client_shuffle_key_x
server_shuffle_ephemeral_key_applied = ~(server_keys.Persistent.Data.ServerShuffleKey << mutual_keys.Persistent.Data.ClientShuffleKeyX) << ~(server_keys.Ephemeral.Data.ServerShuffleEphemeralKey) server_shuffle_ephemeral_key_applied = ~(server_keys.persistent.data.inner_key_1 << mutual_keys.persistent.data.inner_key_2) << ~(server_keys.ephemeral.data.inner_key_1)
server_shuffle_ephemeral_key_applied = ~(server_shuffle_ephemeral_key_applied < outer_server_shuffle_function_ephemeral_key_applied) server_shuffle_ephemeral_key_applied = ~(server_shuffle_ephemeral_key_applied < outer_server_shuffle_function_ephemeral_key_applied)
outer_server_shuffle_ephemeral_key_applied = server_keys.Persistent.Data.OuterServerShuffleKey << server_keys.Ephemeral.Data.OuterServerShuffleEphemeralKey outer_server_shuffle_ephemeral_key_applied = server_keys.persistent.data.outer_key_1 << server_keys.ephemeral.data.outer_key_1
alpha_prep = (alphabet < outer_server_shuffle_ephemeral_key_applied) << server_shuffle_ephemeral_key_applied alpha_prep = (alphabet < outer_server_shuffle_ephemeral_key_applied) << server_shuffle_ephemeral_key_applied
outer_function_ephemeral_key_applied = mutual_keys.Persistent.Data.OuterFunctionKey << mutual_keys.Ephemeral.Data.OuterFunctionKey outer_function_ephemeral_key_applied = mutual_keys.persistent.data.outer_key_1 << mutual_keys.ephemeral.data.outer_key_1
inner_key = function_ephemeral_key_applied inner_key = function_ephemeral_key_applied
operand = alpha_prep operand = alpha_prep
operand1 = server_keys.Persistent.Data.ServerKey < outer_function_ephemeral_key_applied operand1 = server_keys.persistent.data.alpha_key_1 < outer_function_ephemeral_key_applied
operand2 = server_keys.Ephemeral.Data.ServerEphemeralKey < outer_function_ephemeral_key_applied operand2 = server_keys.ephemeral.data.alpha_key_1 < outer_function_ephemeral_key_applied
operand3 = mutual_keys.Persistent.Data.MutualKey < outer_function_ephemeral_key_applied operand3 = mutual_keys.persistent.data.alpha_key_1 < outer_function_ephemeral_key_applied
operand4 = mutual_keys.Ephemeral.Data.MutualKey < outer_function_ephemeral_key_applied operand4 = mutual_keys.ephemeral.data.alpha_key_1 < outer_function_ephemeral_key_applied
alpha_prep = operand ^ (operand1 << inner_key) ^ (operand2 << inner_key) ^ (operand3 << inner_key) ^ (operand4 << inner_key) alpha_prep = operand ^ (operand1 << inner_key) ^ (operand2 << inner_key) ^ (operand3 << inner_key) ^ (operand4 << inner_key)
return resolve_message(alpha_prep.matrix, rx_data.matrix) return resolve_message(alpha_prep.matrix, rx_data.matrix)
@@ -354,103 +345,103 @@ if __name__ == "__main__":
#mutual_ephemeral_keys = {k: {"matrix": v} for k, v in mutual_ephemeral_keys.items()} #mutual_ephemeral_keys = {k: {"matrix": v} for k, v in mutual_ephemeral_keys.items()}
#client_keys = ClientKeys( #client_keys = ClientKeys(
# Persistent=ClientPersistentKeys( # persistent=ClientPersistentKeys(
# Data=ClientPersistentDataKeys( # data=ClientPersistentDataKeys(
# OuterClientShuffleKey=client_persistent_keys["OuterClientShuffleKey"], # outer_key_1=client_persistent_keys["outer_key_1"],
# OuterClientShuffleFunctionKey=client_persistent_keys["OuterClientShuffleFunctionKey"], # outer_key_2=client_persistent_keys["outer_key_2"],
# ClientKey=client_persistent_keys["ClientKey"], # alpha_key_1=client_persistent_keys["alpha_key_1"],
# ClientShuffleKeyA=client_persistent_keys["ClientShuffleKeyA"] # inner_key_2=client_persistent_keys["inner_key_2"]
# ), # ),
# Medium=ClientPersistentMediumKeys( # medium=ClientPersistentMediumKeys(
# OuterClientShuffleMediumKey=client_persistent_keys["OuterClientShuffleMediumKey"], # outer_key_1=client_persistent_keys["outer_key_1"],
# OuterClientShuffleFunctionMediumKey=client_persistent_keys["OuterClientShuffleFunctionMediumKey"], # outer_key_2=client_persistent_keys["outer_key_2"],
# ClientShuffleMediumKeyA=client_persistent_keys["ClientShuffleMediumKeyA"], # inner_key_2=client_persistent_keys["inner_key_2"],
# ClientMediumKey=client_persistent_keys["ClientMediumKey"] # alpha_key_1=client_persistent_keys["alpha_key_1"]
# ) # )
# ), # ),
# Ephemeral=ClientEphemeralKeys( # ephemeral=ClientEphemeralKeys(
# Data=ClientEphemeralDataKeys( # data=ClientEphemeralDataKeys(
# OuterClientShuffleEphemeralKey=client_ephemeral_keys["OuterClientShuffleEphemeralKey"], # outer_key_1=client_ephemeral_keys["outer_key_1"],
# OuterClientShuffleFunctionEphemeralKey=client_ephemeral_keys["OuterClientShuffleFunctionEphemeralKey"], # outer_key_2=client_ephemeral_keys["outer_key_2"],
# ClientEphemeralKey=client_ephemeral_keys["ClientEphemeralKey"], # alpha_key_1=client_ephemeral_keys["alpha_key_1"],
# ClientShuffleEphemeralKeyA=client_ephemeral_keys["ClientShuffleEphemeralKeyA"] # inner_key_2=client_ephemeral_keys["inner_key_2"]
# ), # ),
# Medium=ClientEphemeralMediumKeys( # medium=ClientEphemeralMediumKeys(
# OuterClientShuffleMediumEphemeralKey=client_ephemeral_keys["OuterClientShuffleMediumEphemeralKey"], # outer_key_1=client_ephemeral_keys["outer_key_1"],
# OuterClientShuffleFunctionMediumEphemeralKey=client_ephemeral_keys["OuterClientShuffleFunctionMediumEphemeralKey"], # outer_key_2=client_ephemeral_keys["outer_key_2"],
# ClientShuffleMediumEphemeralKeyA=client_ephemeral_keys["ClientShuffleMediumEphemeralKeyA"], # inner_key_2=client_ephemeral_keys["inner_key_2"],
# ClientMediumEphemeralKey=client_ephemeral_keys["ClientMediumEphemeralKey"] # alpha_key_1=client_ephemeral_keys["alpha_key_1"]
# ) # )
# ) # )
#) #)
#server_keys = ServerKeys( #server_keys = ServerKeys(
# Persistent=ServerPersistentKeys( # persistent=ServerPersistentKeys(
# Data=ServerPersistentDataKeys( # data=ServerPersistentDataKeys(
# OuterServerShuffleKey=server_persistent_keys["OuterServerShuffleKey"], # outer_key_1=server_persistent_keys["outer_key_1"],
# ServerKey=server_persistent_keys["ServerKey"], # alpha_key_1=server_persistent_keys["alpha_key_1"],
# ServerShuffleKey=server_persistent_keys["ServerShuffleKey"] # inner_key_2=server_persistent_keys["inner_key_2"]
# ), # ),
# Medium=ServerPersistentMediumKeys( # medium=ServerPersistentMediumKeys(
# ServerMediumKey=server_persistent_keys["ServerMediumKey"], # alpha_key_1=server_persistent_keys["alpha_key_1"],
# ) # )
# ), # ),
# Ephemeral=ServerEphemeralKeys( # ephemeral=ServerEphemeralKeys(
# Data=ServerEphemeralDataKeys( # data=ServerEphemeralDataKeys(
# OuterServerShuffleEphemeralKey=server_ephemeral_keys["OuterServerShuffleEphemeralKey"], # outer_key_1=server_ephemeral_keys["outer_key_1"],
# ServerEphemeralKey=server_ephemeral_keys["ServerEphemeralKey"], # alpha_key_1=server_ephemeral_keys["alpha_key_1"],
# ServerShuffleEphemeralKey=server_ephemeral_keys["ServerShuffleEphemeralKey"] # inner_key_2=server_ephemeral_keys["inner_key_2"]
# ), # ),
# Medium=ServerEphemeralMediumKeys( # medium=ServerEphemeralMediumKeys(
# ServerMediumEphemeralKey=server_ephemeral_keys["ServerMediumEphemeralKey"], # alpha_key_1=server_ephemeral_keys["alpha_key_1"],
# ) # )
# ) # )
#) #)
#mutual_keys = MutualKeys( #mutual_keys = MutualKeys(
# Persistent=MutualPersistentKeys( # persistent=MutualPersistentKeys(
# Data=MutualPersistentDataKeys( # data=MutualPersistentDataKeys(
# OuterFunctionKey=server_persistent_keys["OuterFunctionKey"], # outer_key_1=server_persistent_keys["outer_key_1"],
# OuterFunctionFunctionKey=server_persistent_keys["OuterFunctionFunctionKey"], # outer_key_2=server_persistent_keys["outer_key_2"],
# OuterServerShuffleFunctionKey=server_persistent_keys["OuterServerShuffleFunctionKey"], # outer_key_6=server_persistent_keys["outer_key_6"],
# MutualKey=server_persistent_keys["MutualKey"], # alpha_key_1=server_persistent_keys["alpha_key_1"],
# Inner1=server_persistent_keys["FunctionKey"], # inner_key_2=server_persistent_keys["FunctionKey"],
# ClientShuffleKeyX=server_persistent_keys["ClientShuffleKeyX"], # inner_key_1=server_persistent_keys["inner_key_1"],
# ), # ),
# Medium=MutualPersistentMediumKeys( # medium=MutualPersistentMediumKeys(
# MutualMediumKey=server_persistent_keys["MutualMediumKey"], # alpha_key_1=server_persistent_keys["alpha_key_1"],
# OuterFunctionMediumKey=server_persistent_keys["OuterFunctionMediumKey"], # outer_key_1=server_persistent_keys["outer_key_1"],
# OuterFunctionFunctionMediumKey=server_persistent_keys["OuterFunctionFunctionMediumKey"], # outer_key_2=server_persistent_keys["outer_key_2"],
# OuterServerShuffleFunctionMediumKey=server_persistent_keys["OuterServerShuffleFunctionMediumKey"], # outer_key_6=server_persistent_keys["outer_key_6"],
# FunctionMediumKey=server_persistent_keys["FunctionMediumKey"], # inner_key_2=server_persistent_keys["inner_key_2"],
# ClientShuffleMediumKeyX=server_persistent_keys["ClientShuffleMediumKeyX"], # inner_key_1=server_persistent_keys["inner_key_1"],
# OuterPositionShuffleMediumKey=server_persistent_keys["OuterPositionShuffleMediumKey"], # outer_key_3=server_persistent_keys["outer_key_3"],
# OuterPositionShuffleFunctionMediumKey=server_persistent_keys["OuterPositionShuffleFunctionMediumKey"], # outer_key_5=server_persistent_keys["outer_key_5"],
# OuterPositionFunctionMediumKey=server_persistent_keys["OuterPositionFunctionMediumKey"], # outer_key_4=server_persistent_keys["outer_key_4"],
# PositionFunctionMediumKey=server_persistent_keys["PositionFunctionMediumKey"], # inner_key_3=server_persistent_keys["inner_key_3"],
# PositionShuffleMediumKey=server_persistent_keys["PositionShuffleMediumKey"], # inner_key_1=server_persistent_keys["inner_key_1"],
# ) # )
# ), # ),
# Ephemeral=MutualEphemeralKeys( # ephemeral=MutualEphemeralKeys(
# Data=MutualEphemeralDataKeys( # data=MutualEphemeralDataKeys(
# MutualKey=mutual_ephemeral_keys["MutualEphemeralKey"], # alpha_key_1=mutual_ephemeral_keys["MutualEphemeralKey"],
# Inner1=mutual_ephemeral_keys["FunctionEphemeralKey"], # inner_key_2=mutual_ephemeral_keys["FunctionEphemeralKey"],
# OuterFunctionKey=mutual_ephemeral_keys["OuterFunctionEphemeralKey"], # outer_key_1=mutual_ephemeral_keys["OuterFunctionEphemeralKey"],
# OuterFunctionFunctionKey=mutual_ephemeral_keys["OuterFunctionFunctionEphemeralKey"], # outer_key_2=mutual_ephemeral_keys["OuterFunctionFunctionEphemeralKey"],
# OuterServerShuffleFunctionKey=mutual_ephemeral_keys["OuterServerShuffleFunctionEphemeralKey"] # outer_key_6=mutual_ephemeral_keys["OuterServerShuffleFunctionEphemeralKey"]
# ), # ),
# Medium=MutualEphemeralMediumKeys( # medium=MutualEphemeralMediumKeys(
# MutualMediumKey=mutual_ephemeral_keys["MutualMediumEphemeralKey"], # alpha_key_1=mutual_ephemeral_keys["MutualMediumEphemeralKey"],
# FunctionMediumKey=mutual_ephemeral_keys["FunctionMediumEphemeralKey"], # inner_key_2=mutual_ephemeral_keys["FunctionMediumEphemeralKey"],
# PositionFunctionMediumEphemeralKey=mutual_ephemeral_keys["PositionFunctionMediumEphemeralKey"], # inner_key_3=mutual_ephemeral_keys["inner_key_3"],
# OuterFunctionMediumEphemeralKey=mutual_ephemeral_keys["OuterFunctionMediumEphemeralKey"], # outer_key_1=mutual_ephemeral_keys["outer_key_1"],
# OuterFunctionFunctionMediumEphemeralKey=mutual_ephemeral_keys["OuterFunctionFunctionMediumEphemeralKey"], # outer_key_2=mutual_ephemeral_keys["outer_key_2"],
# OuterPositionFunctionMediumEphemeralKey=mutual_ephemeral_keys["OuterPositionFunctionMediumEphemeralKey"], # outer_key_6=mutual_ephemeral_keys["outer_key_6"],
# OuterServerShuffleFunctionMediumEphemeralKey=mutual_ephemeral_keys["OuterServerShuffleFunctionMediumEphemeralKey"], # outer_key_3=mutual_ephemeral_keys["outer_key_3"],
# OuterPositionShuffleFunctionMediumEphemeralKey=mutual_ephemeral_keys["OuterPositionShuffleFunctionMediumEphemeralKey"], # outer_key_5=mutual_ephemeral_keys["outer_key_5"],
# PositionShuffleMediumEphemeralKey=mutual_ephemeral_keys["PositionShuffleMediumEphemeralKey"], # inner_key_2=mutual_ephemeral_keys["inner_key_2"],
# OuterPositionShuffleMediumEphemeralKey=mutual_ephemeral_keys["OuterPositionShuffleMediumEphemeralKey"] # outer_key_4=mutual_ephemeral_keys["outer_key_4"]
# ) # )
# ) # )
@@ -463,17 +454,17 @@ if __name__ == "__main__":
client_keys = ClientKeys.random_init(height, width) client_keys = ClientKeys.random_init(height, width)
alphabet = AlphabetKey.init_matrix(width, height, 255) alphabet = AlphabetKey.init_matrix(width, height, 255)
server_keys.Persistent.Data.ServerKey = server_keys.Persistent.Data.ServerKey ^ mutual_keys.Persistent.Data.MutualKey server_keys.persistent.data.alpha_key_1 = server_keys.persistent.data.alpha_key_1 ^ mutual_keys.persistent.data.alpha_key_1
server_keys.Persistent.Medium.ServerMediumKey = server_keys.Persistent.Medium.ServerMediumKey ^ mutual_keys.Persistent.Medium.MutualMediumKey server_keys.persistent.medium.alpha_key_1 = server_keys.persistent.medium.alpha_key_1 ^ mutual_keys.persistent.medium.alpha_key_1
mutual_keys.Persistent.Data.MutualKey = mutual_keys.Persistent.Data.MutualKey ^ client_keys.Persistent.Data.ClientKey mutual_keys.persistent.data.alpha_key_1 = mutual_keys.persistent.data.alpha_key_1 ^ client_keys.persistent.data.alpha_key_1
mutual_keys.Persistent.Medium.MutualMediumKey = mutual_keys.Persistent.Medium.MutualMediumKey ^ client_keys.Persistent.Medium.ClientMediumKey mutual_keys.persistent.medium.alpha_key_1 = mutual_keys.persistent.medium.alpha_key_1 ^ client_keys.persistent.medium.alpha_key_1
(phase1_alphabet, phase1_medium) = darc_phase1(alphabet, server_keys, mutual_keys) (phase1_alphabet, phase1_medium) = darc_phase1(alphabet, server_keys, mutual_keys)
(phase2_alphabet, phase2_medium) = darc_phase2(phase1_alphabet, phase1_medium, client_keys, mutual_keys) (phase2_alphabet, phase2_medium) = darc_phase2(phase1_alphabet, phase1_medium, client_keys, mutual_keys)
(phase3_alphabet, phase3_medium) = darc_phase3(phase2_alphabet, phase2_medium, client_keys, mutual_keys) (phase3_alphabet, phase3_medium) = darc_phase3(phase2_alphabet, phase2_medium, client_keys, mutual_keys)
original_message = [ 0, 2, 4, 6, 0, 5, 9, 9, 1, 7 ] original_message = OuterShuffleKey.init_matrix(height).matrix[0]
darc_message = merge_message(phase3_alphabet, phase3_medium, client_keys, mutual_keys, original_message) darc_message = merge_message(phase3_alphabet, phase3_medium, client_keys, mutual_keys, original_message)
message = darc_phase_4(alphabet, darc_message, server_keys, mutual_keys) message = darc_phase_4(alphabet, darc_message, server_keys, mutual_keys)

View File

@@ -22,7 +22,7 @@ if __name__ == "__main__":
['16', '26', '30', '46', '50', '66', '79'] ['16', '26', '30', '46', '50', '66', '79']
], key_type=DarcKeyTypes.alphabet) ], key_type=DarcKeyTypes.alphabet)
""" Persistent Keys Generation """ """ persistent Keys Generation """
""" """
Outer (Mutual) (Substitution) Function Key 9 7 4 2 5 3 0 6 1 8 Outer (Mutual) (Substitution) Function Key 9 7 4 2 5 3 0 6 1 8
Outer (Mutual) (Substitution) Function Function Key 8 1 4 5 2 3 7 6 0 9 Outer (Mutual) (Substitution) Function Function Key 8 1 4 5 2 3 7 6 0 9
@@ -343,51 +343,51 @@ if __name__ == "__main__":
server_mutual_substitution_key_4 = server_substitution_component_1 ^ shared_mutual_substitution_component_5 server_mutual_substitution_key_4 = server_substitution_component_1 ^ shared_mutual_substitution_component_5
""" Ephemeral Key Generation """ """ ephemeral Key Generation """
""" """
Outer (Mutual) (Substitution) Function Ephemeral Key 0 9 6 2 1 5 3 8 7 4 Outer (Mutual) (Substitution) Function ephemeral Key 0 9 6 2 1 5 3 8 7 4
Outer (Mutual) (Substitution) Function Function Ephemeral Key 2 3 9 7 6 0 1 4 8 5 Outer (Mutual) (Substitution) Function Function ephemeral Key 2 3 9 7 6 0 1 4 8 5
Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key 0 8 5 9 7 3 1 4 6 2 Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key 0 8 5 9 7 3 1 4 6 2
Outer Client Shuffle (Permutation) Ephemeral Key 1 4 2 9 5 7 8 3 0 6 Outer Client Shuffle (Permutation) ephemeral Key 1 4 2 9 5 7 8 3 0 6
Outer Client Shuffle (Permutation) Function Ephemeral Key 4 3 2 5 1 6 7 8 0 9 Outer Client Shuffle (Permutation) Function ephemeral Key 4 3 2 5 1 6 7 8 0 9
Outer Server Shuffle (Permutation) Ephemeral Key 7 5 2 1 8 4 3 6 9 0 Outer Server Shuffle (Permutation) ephemeral Key 7 5 2 1 8 4 3 6 9 0
""" """
# Outer (Mutual) (Substitution) Function Ephemeral Key # Outer (Mutual) (Substitution) Function ephemeral Key
outer_mutual_substitution_function_ephemeral_key = DarcKey(matrix=[ outer_mutual_substitution_function_ephemeral_key = DarcKey(matrix=[
['0', '9', '6', '2', '1', '5', '3', '8', '7', '4'] ['0', '9', '6', '2', '1', '5', '3', '8', '7', '4']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
# Outer (Mutual) (Substitution) Function Function Ephemeral Key # Outer (Mutual) (Substitution) Function Function ephemeral Key
outer_mutual_substitution_function_function_ephemeral_key = DarcKey(matrix=[ outer_mutual_substitution_function_function_ephemeral_key = DarcKey(matrix=[
['2', '3', '9', '7', '6', '0', '1', '4', '8', '5'] ['2', '3', '9', '7', '6', '0', '1', '4', '8', '5']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
# Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key # Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key
outer_server_mutual_shuffle_permutation_function_ephemeral_key = DarcKey(matrix=[ outer_server_mutual_shuffle_permutation_function_ephemeral_key = DarcKey(matrix=[
['0', '8', '5', '9', '7', '3', '1', '4', '6', '2'] ['0', '8', '5', '9', '7', '3', '1', '4', '6', '2']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
# Outer Client Shuffle (Permutation) Ephemeral Key # Outer Client Shuffle (Permutation) ephemeral Key
outer_client_shuffle_permutation_ephemeral_key = DarcKey(matrix=[ outer_client_shuffle_permutation_ephemeral_key = DarcKey(matrix=[
['1', '4', '2', '9', '5', '7', '8', '3', '0', '6'] ['1', '4', '2', '9', '5', '7', '8', '3', '0', '6']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
# Outer Client Shuffle (Permutation) Function Ephemeral Key # Outer Client Shuffle (Permutation) Function ephemeral Key
outer_client_shuffle_permutation_function_ephemeral_key = DarcKey(matrix=[ outer_client_shuffle_permutation_function_ephemeral_key = DarcKey(matrix=[
['4', '3', '2', '5', '1', '6', '7', '8', '0', '9'] ['4', '3', '2', '5', '1', '6', '7', '8', '0', '9']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
# Outer Server Shuffle (Permutation) Ephemeral Key # Outer Server Shuffle (Permutation) ephemeral Key
outer_server_shuffle_permutation_ephemeral_key = DarcKey(matrix=[ outer_server_shuffle_permutation_ephemeral_key = DarcKey(matrix=[
['7', '5', '2', '1', '8', '4', '3', '6', '9', '0'] ['7', '5', '2', '1', '8', '4', '3', '6', '9', '0']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
""" """
(Mutual) (Substitution) Function Ephemeral Key 6 0 1 4 2 3 5 2 3 6 4 0 1 5 2 4 0 3 6 1 5 0 4 2 3 1 5 6 6 4 2 5 1 0 3 5 1 0 6 4 2 3 1 2 4 3 6 0 5 6 1 4 0 5 3 2 2 3 5 4 6 0 1 1 6 4 3 5 2 0 (Mutual) (Substitution) Function ephemeral Key 6 0 1 4 2 3 5 2 3 6 4 0 1 5 2 4 0 3 6 1 5 0 4 2 3 1 5 6 6 4 2 5 1 0 3 5 1 0 6 4 2 3 1 2 4 3 6 0 5 6 1 4 0 5 3 2 2 3 5 4 6 0 1 1 6 4 3 5 2 0
Client Shuffle (Permutation) Ephemeral Key A (remove A) 5 0 4 3 2 6 1 0 6 2 1 5 3 4 1 2 0 3 5 4 6 0 2 6 3 4 5 1 5 1 2 0 3 4 6 1 0 3 4 5 6 2 3 0 5 2 6 4 1 6 4 5 3 0 2 1 2 4 6 0 3 5 1 4 6 2 3 5 1 0 Client Shuffle (Permutation) ephemeral Key A (remove A) 5 0 4 3 2 6 1 0 6 2 1 5 3 4 1 2 0 3 5 4 6 0 2 6 3 4 5 1 5 1 2 0 3 4 6 1 0 3 4 5 6 2 3 0 5 2 6 4 1 6 4 5 3 0 2 1 2 4 6 0 3 5 1 4 6 2 3 5 1 0
Server Shuffle (Permutation) Ephemeral Key 1 (remove 1) 6 1 3 0 4 2 5 3 2 1 0 4 5 6 2 4 3 5 0 6 1 4 1 3 6 0 2 5 1 4 2 3 0 5 6 6 4 5 0 2 3 1 0 4 2 3 1 5 6 0 6 3 5 1 2 4 2 6 3 1 4 5 0 5 0 4 1 6 3 2 Server Shuffle (Permutation) ephemeral Key 1 (remove 1) 6 1 3 0 4 2 5 3 2 1 0 4 5 6 2 4 3 5 0 6 1 4 1 3 6 0 2 5 1 4 2 3 0 5 6 6 4 5 0 2 3 1 0 4 2 3 1 5 6 0 6 3 5 1 2 4 2 6 3 1 4 5 0 5 0 4 1 6 3 2
""" """
# (Mutual) (Substitution) Function Ephemeral Key # (Mutual) (Substitution) Function ephemeral Key
mutual_substitution_function_ephemeral_key = DarcKey(matrix=[ mutual_substitution_function_ephemeral_key = DarcKey(matrix=[
['6', '0', '1', '4', '2', '3', '5'], ['6', '0', '1', '4', '2', '3', '5'],
['2', '3', '6', '4', '0', '1', '5'], ['2', '3', '6', '4', '0', '1', '5'],
@@ -401,7 +401,7 @@ if __name__ == "__main__":
['1', '6', '4', '3', '5', '2', '0'] ['1', '6', '4', '3', '5', '2', '0']
], key_type=DarcKeyTypes.inner_shuffle) ], key_type=DarcKeyTypes.inner_shuffle)
# Client Shuffle (Permutation) Ephemeral Key A (remove A) # Client Shuffle (Permutation) ephemeral Key A (remove A)
client_shuffle_permutation_ephemeral_key_a = DarcKey(matrix=[ client_shuffle_permutation_ephemeral_key_a = DarcKey(matrix=[
['5', '0', '4', '3', '2', '6', '1'], ['5', '0', '4', '3', '2', '6', '1'],
['0', '6', '2', '1', '5', '3', '4'], ['0', '6', '2', '1', '5', '3', '4'],
@@ -415,7 +415,7 @@ if __name__ == "__main__":
['4', '6', '2', '3', '5', '1', '0'] ['4', '6', '2', '3', '5', '1', '0']
], key_type=DarcKeyTypes.inner_shuffle) ], key_type=DarcKeyTypes.inner_shuffle)
# Server Shuffle (Permutation) Ephemeral Key 1 (remove 1) # Server Shuffle (Permutation) ephemeral Key 1 (remove 1)
server_shuffle_permutation_ephemeral_key_1 = DarcKey(matrix=[ server_shuffle_permutation_ephemeral_key_1 = DarcKey(matrix=[
['6', '1', '3', '0', '4', '2', '5'], ['6', '1', '3', '0', '4', '2', '5'],
['3', '2', '1', '0', '4', '5', '6'], ['3', '2', '1', '0', '4', '5', '6'],
@@ -429,16 +429,16 @@ if __name__ == "__main__":
['5', '0', '4', '1', '6', '3', '2'] ['5', '0', '4', '1', '6', '3', '2']
], key_type=DarcKeyTypes.inner_shuffle) ], key_type=DarcKeyTypes.inner_shuffle)
# Server (Substitution) Ephemeral Unique Component Function # Server (Substitution) ephemeral Unique Component Function
server_substitution_ephemeral_unique_component_function = 5 server_substitution_ephemeral_unique_component_function = 5
""" """
Shared (Mutual) (Substitution) Ephemeral Key 106 113 9 54 49 4 207 184 3 232 179 15 113 142 129 44 164 54 1 32 201 106 50 246 140 149 179 109 210 11 69 193 77 245 62 37 76 137 24 220 30 165 40 57 147 225 24 176 103 37 212 189 203 218 138 168 73 227 38 164 20 239 24 7 194 254 76 0 244 215 Shared (Mutual) (Substitution) ephemeral Key 106 113 9 54 49 4 207 184 3 232 179 15 113 142 129 44 164 54 1 32 201 106 50 246 140 149 179 109 210 11 69 193 77 245 62 37 76 137 24 220 30 165 40 57 147 225 24 176 103 37 212 189 203 218 138 168 73 227 38 164 20 239 24 7 194 254 76 0 244 215
Client (Substitution) Ephemeral Key 21 149 75 73 228 81 79 41 189 80 209 45 101 53 139 238 141 159 30 79 214 239 234 72 75 80 190 124 203 225 246 200 205 195 92 201 185 113 101 176 216 106 14 210 125 70 53 128 57 115 27 97 39 199 26 104 29 4 55 5 13 57 19 158 184 137 0 221 12 217 Client (Substitution) ephemeral Key 21 149 75 73 228 81 79 41 189 80 209 45 101 53 139 238 141 159 30 79 214 239 234 72 75 80 190 124 203 225 246 200 205 195 92 201 185 113 101 176 216 106 14 210 125 70 53 128 57 115 27 97 39 199 26 104 29 4 55 5 13 57 19 158 184 137 0 221 12 217
Server (Substitution) Ephemeral Random Component 191 50 229 60 201 64 45 31 88 90 8 153 6 228 117 63 38 90 236 207 254 64 219 36 3 119 205 171 172 138 153 52 161 137 216 49 150 210 129 174 190 54 81 230 135 200 218 31 52 128 253 177 220 1 83 3 204 199 43 50 148 215 6 79 124 128 30 74 242 85 Server (Substitution) ephemeral Random Component 191 50 229 60 201 64 45 31 88 90 8 153 6 228 117 63 38 90 236 207 254 64 219 36 3 119 205 171 172 138 153 52 161 137 216 49 150 210 129 174 190 54 81 230 135 200 218 31 52 128 253 177 220 1 83 3 204 199 43 50 148 215 6 79 124 128 30 74 242 85
""" """
# Shared (Mutual) (Substitution) Ephemeral Key # Shared (Mutual) (Substitution) ephemeral Key
shared_mutual_substitution_ephemeral_key = DarcKey(matrix=[ shared_mutual_substitution_ephemeral_key = DarcKey(matrix=[
['106', '113', '9', '54', '49', '4', '207'], ['106', '113', '9', '54', '49', '4', '207'],
['184', '3', '232', '179', '15', '113', '142'], ['184', '3', '232', '179', '15', '113', '142'],
@@ -452,7 +452,7 @@ if __name__ == "__main__":
['7', '194', '254', '76', '0', '244', '215'] ['7', '194', '254', '76', '0', '244', '215']
], key_type=DarcKeyTypes.alphabet) ], key_type=DarcKeyTypes.alphabet)
# Client (Substitution) Ephemeral Key # Client (Substitution) ephemeral Key
client_substitution_ephemeral_key = DarcKey(matrix=[ client_substitution_ephemeral_key = DarcKey(matrix=[
['21', '149', '75', '73', '228', '81', '79'], ['21', '149', '75', '73', '228', '81', '79'],
['41', '189', '80', '209', '45', '101', '53'], ['41', '189', '80', '209', '45', '101', '53'],
@@ -466,7 +466,7 @@ if __name__ == "__main__":
['158', '184', '137', '0', '221', '12', '217'] ['158', '184', '137', '0', '221', '12', '217']
], key_type=DarcKeyTypes.alphabet) ], key_type=DarcKeyTypes.alphabet)
# Server (Substitution) Ephemeral Random Component # Server (Substitution) ephemeral Random Component
server_substitution_ephemeral_random_component = DarcKey(matrix=[ server_substitution_ephemeral_random_component = DarcKey(matrix=[
['191', '50', '229', '60', '201', '64', '45'], ['191', '50', '229', '60', '201', '64', '45'],
['31', '88', '90', '8', '153', '6', '228'], ['31', '88', '90', '8', '153', '6', '228'],
@@ -481,42 +481,42 @@ if __name__ == "__main__":
], key_type=DarcKeyTypes.alphabet) ], key_type=DarcKeyTypes.alphabet)
""" """
Server (Substitution) Ephemeral Unique Component 7 190 58 75 135 15 214 149 244 224 Server (Substitution) ephemeral Unique Component 7 190 58 75 135 15 214 149 244 224
""" """
# Server (Substitution) Ephemeral Unique Component # Server (Substitution) ephemeral Unique Component
server_substitution_ephemeral_unique_component = DarcKey(matrix=[ server_substitution_ephemeral_unique_component = DarcKey(matrix=[
['7', '190', '58', '75', '135', '15', '214', '149', '244', '224'] ['7', '190', '58', '75', '135', '15', '214', '149', '244', '224']
], key_type=DarcKeyTypes.alphabet) ], key_type=DarcKeyTypes.alphabet)
# Outer (Mutual) Function Function Ephemeral Key Applied = Outer (Mutual) (Substitution) Function Function Key << Outer (Mutual) (Substitution) Function Function Ephemeral Key # Outer (Mutual) Function Function ephemeral Key Applied = Outer (Mutual) (Substitution) Function Function Key << Outer (Mutual) (Substitution) Function Function ephemeral Key
outer_mutual_function_function_ephemeral_key_applied = outer_mutual_substitution_function_function_key << outer_mutual_substitution_function_function_ephemeral_key outer_mutual_function_function_ephemeral_key_applied = outer_mutual_substitution_function_function_key << outer_mutual_substitution_function_function_ephemeral_key
# Inner (Mutual) Function Applied Key = (Mutual) (Substitution) Function Key << (Mutual) (Substitution) Function Ephemeral Key # Inner (Mutual) Function Applied Key = (Mutual) (Substitution) Function Key << (Mutual) (Substitution) Function ephemeral Key
inner_mutual_function_applied_key = mutual_substitution_function_key << mutual_substitution_function_ephemeral_key inner_mutual_function_applied_key = mutual_substitution_function_key << mutual_substitution_function_ephemeral_key
# Inner (Mutual) Function Key Scratch = Inner (Mutual) Function Applied Key << Outer (Mutual) Function Function Ephemeral Key Applied # Inner (Mutual) Function Key Scratch = Inner (Mutual) Function Applied Key << Outer (Mutual) Function Function ephemeral Key Applied
inner_mutual_function_key_scratch = inner_mutual_function_applied_key < outer_mutual_function_function_ephemeral_key_applied inner_mutual_function_key_scratch = inner_mutual_function_applied_key < outer_mutual_function_function_ephemeral_key_applied
# Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied = Outer Server (Mutual) Shuffle (Permutation) Function Key << Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key # Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied = Outer Server (Mutual) Shuffle (Permutation) Function Key << Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key
outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied = outer_mutual_shuffle_permutation_function_key << outer_server_mutual_shuffle_permutation_function_ephemeral_key outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied = outer_mutual_shuffle_permutation_function_key << outer_server_mutual_shuffle_permutation_function_ephemeral_key
# Client Shuffle (Permutation) Key X Scratch = Client Shuffle (Permutation) Key X < Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied # Client Shuffle (Permutation) Key X Scratch = Client Shuffle (Permutation) Key X < Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied
client_shuffle_permutation_key_x_scratch = client_shuffle_permutation_key_x < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied client_shuffle_permutation_key_x_scratch = client_shuffle_permutation_key_x < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied
# Inner Function Key Scratch 2 = Inner (Mutual) Function Key Scratch << Client Shuffle (Permutation) Key X Scratch # Inner Function Key Scratch 2 = Inner (Mutual) Function Key Scratch << Client Shuffle (Permutation) Key X Scratch
inner_function_key_scratch_2 = inner_mutual_function_key_scratch << client_shuffle_permutation_key_x_scratch inner_function_key_scratch_2 = inner_mutual_function_key_scratch << client_shuffle_permutation_key_x_scratch
# Outer (Mutual) Function Ephemeral Key Applied = Outer (Mutual) (Substitution) Function Key < Outer (Mutual) (Substitution) Function Ephemeral Key # Outer (Mutual) Function ephemeral Key Applied = Outer (Mutual) (Substitution) Function Key < Outer (Mutual) (Substitution) Function ephemeral Key
outer_mutual_function_ephemeral_key_applied = outer_mutual_substitution_function_key << outer_mutual_substitution_function_ephemeral_key outer_mutual_function_ephemeral_key_applied = outer_mutual_substitution_function_key << outer_mutual_substitution_function_ephemeral_key
# Server (Substitution) Key Scratch = Server (Substitution) Key < Outer (Mutual) Function Ephemeral Key Applied # Server (Substitution) Key Scratch = Server (Substitution) Key < Outer (Mutual) Function ephemeral Key Applied
server_substitution_key_scratch = server_substitution_key < outer_mutual_function_ephemeral_key_applied server_substitution_key_scratch = server_substitution_key < outer_mutual_function_ephemeral_key_applied
# Shared (Mutual) (Substitution) Key Scratch = Shared (Mutual) (Substitution) Key < Outer (Mutual) Function Ephemeral Key Applied # Shared (Mutual) (Substitution) Key Scratch = Shared (Mutual) (Substitution) Key < Outer (Mutual) Function ephemeral Key Applied
shared_mutual_substitution_key_scratch = shared_mutual_substitution_key < outer_mutual_function_ephemeral_key_applied shared_mutual_substitution_key_scratch = shared_mutual_substitution_key < outer_mutual_function_ephemeral_key_applied
# Shared (Mutual) (Substitution) Ephemeral Key Server Scratch = Shared (Mutual) (Substitution) Ephemeral Key < Outer (Mutual) Function Ephemeral Key Applied # Shared (Mutual) (Substitution) ephemeral Key Server Scratch = Shared (Mutual) (Substitution) ephemeral Key < Outer (Mutual) Function ephemeral Key Applied
shared_mutual_substitution_ephemeral_key_server_scratch = shared_mutual_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied shared_mutual_substitution_ephemeral_key_server_scratch = shared_mutual_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied
# line 78 # line 78
@@ -526,43 +526,43 @@ if __name__ == "__main__":
# Server Client Shuffle (Permutation) Inverse # Server Client Shuffle (Permutation) Inverse
server_client_shuffle_permutation_inverse = ~server_client_shuffle_permutation server_client_shuffle_permutation_inverse = ~server_client_shuffle_permutation
# Server Shuffle (Permutation) Ephemeral Key 1 Inverse (remove 1) = ~(Server Shuffle (Permutation) Ephemeral Key 1 (remove 1)) # Server Shuffle (Permutation) ephemeral Key 1 Inverse (remove 1) = ~(Server Shuffle (Permutation) ephemeral Key 1 (remove 1))
server_shuffle_permutation_ephemeral_key_1_inverse = ~server_shuffle_permutation_ephemeral_key_1 server_shuffle_permutation_ephemeral_key_1_inverse = ~server_shuffle_permutation_ephemeral_key_1
# Server Shuffle (Permutation) Ephemeral Key Applied = Server Client Shuffle (Permutation) Inverse < Server Shuffle (Permutation) Ephemeral Key 1 Inverse (remove 1) # Server Shuffle (Permutation) ephemeral Key Applied = Server Client Shuffle (Permutation) Inverse < Server Shuffle (Permutation) ephemeral Key 1 Inverse (remove 1)
server_shuffle_permutation_ephemeral_key_applied = server_client_shuffle_permutation_inverse << server_shuffle_permutation_ephemeral_key_1_inverse server_shuffle_permutation_ephemeral_key_applied = server_client_shuffle_permutation_inverse << server_shuffle_permutation_ephemeral_key_1_inverse
# line 82 # line 82
# Server Shuffle (Permutation) Ephemeral Key Applied Scratch = Server Shuffle (Permutation) Ephemeral Key Applied < Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied # Server Shuffle (Permutation) ephemeral Key Applied Scratch = Server Shuffle (Permutation) ephemeral Key Applied < Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied
server_shuffle_permutation_ephemeral_key_applied_scratch = server_shuffle_permutation_ephemeral_key_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied server_shuffle_permutation_ephemeral_key_applied_scratch = server_shuffle_permutation_ephemeral_key_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied
# Server Shuffle (Permutation) Ephemeral Key Applied Scratch Inverse = ~Server Shuffle (Permutation) Ephemeral Key Applied Scratch # Server Shuffle (Permutation) ephemeral Key Applied Scratch Inverse = ~Server Shuffle (Permutation) ephemeral Key Applied Scratch
server_shuffle_permutation_ephemeral_key_applied_scratch_inverse = ~server_shuffle_permutation_ephemeral_key_applied_scratch server_shuffle_permutation_ephemeral_key_applied_scratch_inverse = ~server_shuffle_permutation_ephemeral_key_applied_scratch
# Outer Server Shuffle (Permutation) Ephemeral Key Applied = Outer Server Shuffle (Permutation) Key < Outer Server Shuffle (Permutation) Ephemeral Key # Outer Server Shuffle (Permutation) ephemeral Key Applied = Outer Server Shuffle (Permutation) Key < Outer Server Shuffle (Permutation) ephemeral Key
outer_server_shuffle_permutation_ephemeral_key_applied = outer_server_shuffle_permutation_key << outer_server_shuffle_permutation_ephemeral_key outer_server_shuffle_permutation_ephemeral_key_applied = outer_server_shuffle_permutation_key << outer_server_shuffle_permutation_ephemeral_key
# Alphabet Scratch 1 = Alphabet Values < Outer Server Shuffle (Permutation) Ephemeral Key Applied # Alphabet Scratch 1 = Alphabet Values < Outer Server Shuffle (Permutation) ephemeral Key Applied
alphabet_scratch_1 = alphabet_values < outer_server_shuffle_permutation_ephemeral_key_applied alphabet_scratch_1 = alphabet_values < outer_server_shuffle_permutation_ephemeral_key_applied
# Alphabet Scratch 2 = Alphabet Scratch 1 << Server Shuffle (Permutation) Ephemeral Key Applied Scratch Inverse # Alphabet Scratch 2 = Alphabet Scratch 1 << Server Shuffle (Permutation) ephemeral Key Applied Scratch Inverse
alphabet_scratch_2 = alphabet_scratch_1 << server_shuffle_permutation_ephemeral_key_applied_scratch_inverse alphabet_scratch_2 = alphabet_scratch_1 << server_shuffle_permutation_ephemeral_key_applied_scratch_inverse
# Server (Substitution) Ephemeral Component Scratch 1 = Server (Substitution) Ephemeral Random Component.column_substitution( Server (Substitution) Ephemeral Unique Component Function ,Server (Substitution) Ephemeral Unique Component) # Server (Substitution) ephemeral Component Scratch 1 = Server (Substitution) ephemeral Random Component.column_substitution( Server (Substitution) ephemeral Unique Component Function ,Server (Substitution) ephemeral Unique Component)
server_substitution_ephemeral_component_scratch_1 = server_substitution_ephemeral_random_component.column_substitution( server_substitution_ephemeral_component_scratch_1 = server_substitution_ephemeral_random_component.column_substitution(
server_substitution_ephemeral_unique_component_function, server_substitution_ephemeral_unique_component_function,
server_substitution_ephemeral_unique_component.matrix[0] server_substitution_ephemeral_unique_component.matrix[0]
) )
# Server (Substitution) Ephemeral Component Scratch 2 = Server (Substitution) Ephemeral Component Scratch 1 < Outer (Mutual) Function Ephemeral Key Applied # Server (Substitution) ephemeral Component Scratch 2 = Server (Substitution) ephemeral Component Scratch 1 < Outer (Mutual) Function ephemeral Key Applied
server_substitution_ephemeral_component_scratch_2 = server_substitution_ephemeral_component_scratch_1 < outer_mutual_function_ephemeral_key_applied server_substitution_ephemeral_component_scratch_2 = server_substitution_ephemeral_component_scratch_1 < outer_mutual_function_ephemeral_key_applied
""" """
# Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) Ephemeral Component Scratch 2 << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Ephemeral Key Server Scratch << Inner Function Key Scratch 2) # Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) ephemeral Component Scratch 2 << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) ephemeral Key Server Scratch << Inner Function Key Scratch 2)
=BITXOR( =BITXOR(
# Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) Ephemeral Component Scratch 2 << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) # Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) ephemeral Component Scratch 2 << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2)
BITXOR( BITXOR(
# Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) Ephemeral Component Scratch 2 << Inner Function Key Scratch 2) # Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) ephemeral Component Scratch 2 << Inner Function Key Scratch 2)
BITXOR( BITXOR(
# Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) # Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2)
BITXOR( BITXOR(
@@ -584,7 +584,7 @@ if __name__ == "__main__":
) )
), ),
# Server (Substitution) Ephemeral Component Scratch 2 << Inner Function Key Scratch 2 # Server (Substitution) ephemeral Component Scratch 2 << Inner Function Key Scratch 2
HLOOKUP( HLOOKUP(
BN73, # Inner Function Key Scratch 2 BN73, # Inner Function Key Scratch 2
INDIRECT( INDIRECT(
@@ -596,7 +596,7 @@ if __name__ == "__main__":
@CELL("col", BN$5) - BN$5 + $E$2 - 1 @CELL("col", BN$5) - BN$5 + $E$2 - 1
) )
), ),
ROW($BB88) - ROW($BD$5) + 1, # Server (Substitution) Ephemeral Component Scratch 2 ROW($BB88) - ROW($BD$5) + 1, # Server (Substitution) ephemeral Component Scratch 2
FALSE FALSE
) )
), ),
@@ -616,7 +616,7 @@ if __name__ == "__main__":
FALSE FALSE
) )
), ),
# Shared (Mutual) (Substitution) Ephemeral Key Server Scratch << Inner Function Key Scratch 2 # Shared (Mutual) (Substitution) ephemeral Key Server Scratch << Inner Function Key Scratch 2
HLOOKUP( HLOOKUP(
BN73, # Inner Function Key Scratch 2 BN73, # Inner Function Key Scratch 2
INDIRECT( INDIRECT(
@@ -628,25 +628,25 @@ if __name__ == "__main__":
@CELL("col", BN$5) - BN$5 + $E$2 - 1 @CELL("col", BN$5) - BN$5 + $E$2 - 1
) )
), ),
ROW($BB77) - ROW($BD$5) + 1, # Shared (Mutual) (Substitution) Ephemeral Key Server Scratch ROW($BB77) - ROW($BD$5) + 1, # Shared (Mutual) (Substitution) ephemeral Key Server Scratch
FALSE FALSE
) )
) )
""" """
# Server (Substitution) Ephemeral Component Scratch 3 = Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) Ephemeral Component Scratch 2 << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Ephemeral Key Server Scratch << Inner Function Key Scratch 2) # Server (Substitution) ephemeral Component Scratch 3 = Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) ephemeral Component Scratch 2 << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) ephemeral Key Server Scratch << Inner Function Key Scratch 2)
server_substitution_ephemeral_component_scratch_3 = alphabet_scratch_2 ^ (server_substitution_key_scratch << inner_function_key_scratch_2) ^ (server_substitution_ephemeral_component_scratch_2 << inner_function_key_scratch_2) ^ (shared_mutual_substitution_key_scratch << inner_function_key_scratch_2) ^ (shared_mutual_substitution_ephemeral_key_server_scratch << inner_function_key_scratch_2) server_substitution_ephemeral_component_scratch_3 = alphabet_scratch_2 ^ (server_substitution_key_scratch << inner_function_key_scratch_2) ^ (server_substitution_ephemeral_component_scratch_2 << inner_function_key_scratch_2) ^ (shared_mutual_substitution_key_scratch << inner_function_key_scratch_2) ^ (shared_mutual_substitution_ephemeral_key_server_scratch << inner_function_key_scratch_2)
# Inner Function Key Scratch 2 Inverse = ~Inner Function Key Scratch 2 # Inner Function Key Scratch 2 Inverse = ~Inner Function Key Scratch 2
inner_function_key_scratch_2_inverse = ~inner_function_key_scratch_2 inner_function_key_scratch_2_inverse = ~inner_function_key_scratch_2
# Server (Substitution) Ephemeral Key Scratch = Server (Substitution) Ephemeral Component Scratch 3 << Inner Function Key Scratch 2 Inverse # Server (Substitution) ephemeral Key Scratch = Server (Substitution) ephemeral Component Scratch 3 << Inner Function Key Scratch 2 Inverse
server_substitution_ephemeral_key_scratch = server_substitution_ephemeral_component_scratch_3 << inner_function_key_scratch_2_inverse server_substitution_ephemeral_key_scratch = server_substitution_ephemeral_component_scratch_3 << inner_function_key_scratch_2_inverse
# Outer (Mutual) Function Ephemeral Key Applied Inverse = ~Outer (Mutual) Function Ephemeral Key Applied # Outer (Mutual) Function ephemeral Key Applied Inverse = ~Outer (Mutual) Function ephemeral Key Applied
outer_mutual_function_ephemeral_key_applied_inverse = ~outer_mutual_function_ephemeral_key_applied outer_mutual_function_ephemeral_key_applied_inverse = ~outer_mutual_function_ephemeral_key_applied
# Server (Substitution) Ephemeral Key = Server (Substitution) Ephemeral Key Scratch < Outer (Mutual) Function Ephemeral Key Applied Inverse # Server (Substitution) ephemeral Key = Server (Substitution) ephemeral Key Scratch < Outer (Mutual) Function ephemeral Key Applied Inverse
server_substitution_ephemeral_key = server_substitution_ephemeral_key_scratch < outer_mutual_function_ephemeral_key_applied_inverse server_substitution_ephemeral_key = server_substitution_ephemeral_key_scratch < outer_mutual_function_ephemeral_key_applied_inverse
""" """
server_substitution_ephemeral_key_expected = 159 243 217 236 133 191 86 8 248 18 181 54 164 252 86 139 223 48 37 67 24 126 115 91 230 221 105 196 56 172 101 158 124 89 183 228 118 232 199 12 229 156 157 115 233 158 138 123 11 211 238 246 43 210 158 65 62 158 234 252 88 81 243 67 209 43 108 31 29 28 server_substitution_ephemeral_key_expected = 159 243 217 236 133 191 86 8 248 18 181 54 164 252 86 139 223 48 37 67 24 126 115 91 230 221 105 196 56 172 101 158 124 89 183 228 118 232 199 12 229 156 157 115 233 158 138 123 11 211 238 246 43 210 158 65 62 158 234 252 88 81 243 67 209 43 108 31 29 28
@@ -671,13 +671,13 @@ if __name__ == "__main__":
# line 94 # line 94
""" Server Tx (Phase 1) """ """ Server Tx (Phase 1) """
# Inner Server Shuffle (Permutation) Key Applied = Server Shuffle (Permutation) Ephemeral Key 1 (remove 1) << Server Shuffle (Permutation) Key # Inner Server Shuffle (Permutation) Key Applied = Server Shuffle (Permutation) ephemeral Key 1 (remove 1) << Server Shuffle (Permutation) Key
inner_server_shuffle_permutation_key_applied = server_shuffle_permutation_ephemeral_key_1 << server_shuffle_permutation_key inner_server_shuffle_permutation_key_applied = server_shuffle_permutation_ephemeral_key_1 << server_shuffle_permutation_key
# Outer Server Shuffle (Permutation) Key Applied = Inner Server Shuffle (Permutation) Key Applied < Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied # Outer Server Shuffle (Permutation) Key Applied = Inner Server Shuffle (Permutation) Key Applied < Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied
outer_server_shuffle_permutation_key_applied = inner_server_shuffle_permutation_key_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied outer_server_shuffle_permutation_key_applied = inner_server_shuffle_permutation_key_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied
# Server (Substitution) Ephemeral Key Scratch = Server (Substitution) Ephemeral Key < Outer (Mutual) Function Ephemeral Key Applied # Server (Substitution) ephemeral Key Scratch = Server (Substitution) ephemeral Key < Outer (Mutual) Function ephemeral Key Applied
server_substitution_ephemeral_key_scratch = server_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied server_substitution_ephemeral_key_scratch = server_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied
@@ -685,32 +685,32 @@ if __name__ == "__main__":
server_substitution_key_scratch_2 = server_substitution_key_scratch server_substitution_key_scratch_2 = server_substitution_key_scratch
# line 105 # line 105
# Outer (Mutual) Function Function Ephemeral Key Applied = Outer (Mutual) (Substitution) Function Function Key << Outer (Mutual) (Substitution) Function Function Ephemeral Key # Outer (Mutual) Function Function ephemeral Key Applied = Outer (Mutual) (Substitution) Function Function Key << Outer (Mutual) (Substitution) Function Function ephemeral Key
outer_mutual_function_function_ephemeral_key_applied = outer_mutual_substitution_function_function_key << outer_mutual_substitution_function_function_ephemeral_key outer_mutual_function_function_ephemeral_key_applied = outer_mutual_substitution_function_function_key << outer_mutual_substitution_function_function_ephemeral_key
# line 108 # line 108
""" Server Tx (Phase 1) """ """ Server Tx (Phase 1) """
# Client (Substitution) Key A Scratch = Client (Substitution) Key < Outer (Mutual) Function Ephemeral Key Applied # Client (Substitution) Key A Scratch = Client (Substitution) Key < Outer (Mutual) Function ephemeral Key Applied
client_substitution_key_a_scratch = client_substitution_key < outer_mutual_function_ephemeral_key_applied client_substitution_key_a_scratch = client_substitution_key < outer_mutual_function_ephemeral_key_applied
# Client (Substitution) Ephemeral Key A Scratch = Client (Substitution) Ephemeral Key < Outer (Mutual) Function Ephemeral Key Applied # Client (Substitution) ephemeral Key A Scratch = Client (Substitution) ephemeral Key < Outer (Mutual) Function ephemeral Key Applied
client_substitution_ephemeral_key_a_scratch = client_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied client_substitution_ephemeral_key_a_scratch = client_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied
# Client Shuffle (Permutation) Key A Applied (remove A) = Client Shuffle (Permutation) Key A Applied (remove A) << Client Shuffle (Permutation) Ephemeral Key A (remove A) # Client Shuffle (Permutation) Key A Applied (remove A) = Client Shuffle (Permutation) Key A Applied (remove A) << Client Shuffle (Permutation) ephemeral Key A (remove A)
client_shuffle_permutation_key_a_applied = client_shuffle_permutation_key_a << client_shuffle_permutation_ephemeral_key_a client_shuffle_permutation_key_a_applied = client_shuffle_permutation_key_a << client_shuffle_permutation_ephemeral_key_a
# Client Shuffle (Permutation) Key A Scratch (remove A) = Client Shuffle (Permutation) Key A Applied (remove A) < Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied # Client Shuffle (Permutation) Key A Scratch (remove A) = Client Shuffle (Permutation) Key A Applied (remove A) < Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied
client_shuffle_permutation_key_a_scratch = client_shuffle_permutation_key_a_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied client_shuffle_permutation_key_a_scratch = client_shuffle_permutation_key_a_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied
# Outer Client Shuffle (Permutation) Ephemeral Key Applied = Outer Client Shuffle (Permutation) Key << Outer Client Shuffle (Permutation) Ephemeral Key # Outer Client Shuffle (Permutation) ephemeral Key Applied = Outer Client Shuffle (Permutation) Key << Outer Client Shuffle (Permutation) ephemeral Key
outer_client_shuffle_permutation_ephemeral_key_applied = outer_client_shuffle_permutation_key << outer_client_shuffle_permutation_ephemeral_key outer_client_shuffle_permutation_ephemeral_key_applied = outer_client_shuffle_permutation_key << outer_client_shuffle_permutation_ephemeral_key
# Outer Client Shuffle (Permutation) Function Ephemeral Key Applied = Outer Client Shuffle (Permutation) Function Key << Outer Client Shuffle (Permutation) Function Ephemeral Key # Outer Client Shuffle (Permutation) Function ephemeral Key Applied = Outer Client Shuffle (Permutation) Function Key << Outer Client Shuffle (Permutation) Function ephemeral Key
outer_client_shuffle_permutation_function_ephemeral_key_applied = outer_client_shuffle_permutation_function_key << outer_client_shuffle_permutation_function_ephemeral_key outer_client_shuffle_permutation_function_ephemeral_key_applied = outer_client_shuffle_permutation_function_key << outer_client_shuffle_permutation_function_ephemeral_key
# Outer Client Shuffle (Permutation) Function Key Applied = Outer Client Shuffle (Permutation) Ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Ephemeral Key Applied # Outer Client Shuffle (Permutation) Function Key Applied = Outer Client Shuffle (Permutation) ephemeral Key Applied << Outer Client Shuffle (Permutation) Function ephemeral Key Applied
outer_client_shuffle_permutation_function_key_applied = outer_client_shuffle_permutation_ephemeral_key_applied << outer_client_shuffle_permutation_function_ephemeral_key_applied outer_client_shuffle_permutation_function_key_applied = outer_client_shuffle_permutation_ephemeral_key_applied << outer_client_shuffle_permutation_function_ephemeral_key_applied
# Outer Client Shuffle (Permutation) Function Key Applied Inverse = ~Outer Client Shuffle (Permutation) Function Key Applied # Outer Client Shuffle (Permutation) Function Key Applied Inverse = ~Outer Client Shuffle (Permutation) Function Key Applied
@@ -737,14 +737,14 @@ if __name__ == "__main__":
# Client Shuffle (Permutation) Key B (remove B) = Client Shuffle (Permutation) Key A Inverse (remove A) << Client Shuffle (Permutation) Key X # Client Shuffle (Permutation) Key B (remove B) = Client Shuffle (Permutation) Key A Inverse (remove A) << Client Shuffle (Permutation) Key X
client_shuffle_permutation_key_b = client_shuffle_permutation_key_a_inverse << client_shuffle_permutation_key_x client_shuffle_permutation_key_b = client_shuffle_permutation_key_a_inverse << client_shuffle_permutation_key_x
# Client Shuffle (Permutation) Ephemeral Key A (remove A) Inverse = ~Client Shuffle (Permutation) Ephemeral Key A (remove A) # Client Shuffle (Permutation) ephemeral Key A (remove A) Inverse = ~Client Shuffle (Permutation) ephemeral Key A (remove A)
client_shuffle_permutation_ephemeral_key_a_inverse = ~client_shuffle_permutation_ephemeral_key_a client_shuffle_permutation_ephemeral_key_a_inverse = ~client_shuffle_permutation_ephemeral_key_a
# Client Shuffle (Permutation) Key B Applied = Client Shuffle (Permutation) Ephemeral Key B << Client Shuffle (Permutation) Key B (remove B) # Client Shuffle (Permutation) Key B Applied = Client Shuffle (Permutation) ephemeral Key B << Client Shuffle (Permutation) Key B (remove B)
client_shuffle_permutation_key_b_applied = client_shuffle_permutation_ephemeral_key_a_inverse << client_shuffle_permutation_key_b client_shuffle_permutation_key_b_applied = client_shuffle_permutation_ephemeral_key_a_inverse << client_shuffle_permutation_key_b
# Outer Server (Mutual) Shuffle (Permutation) Function Key Scratch = Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied # Outer Server (Mutual) Shuffle (Permutation) Function Key Scratch = Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied
outer_server_mutual_shuffle_permutation_function_key_scratch = outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied outer_server_mutual_shuffle_permutation_function_key_scratch = outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied
# Client Shuffle (Permutation) Key B Scratch = Client Shuffle (Permutation) Key B Applied < Outer Server (Mutual) Shuffle (Permutation) Function Key Scratch # Client Shuffle (Permutation) Key B Scratch = Client Shuffle (Permutation) Key B Applied < Outer Server (Mutual) Shuffle (Permutation) Function Key Scratch
@@ -754,7 +754,7 @@ if __name__ == "__main__":
client_shuffle_permutation_key_x_scratch_2 = client_shuffle_permutation_key_x < outer_server_mutual_shuffle_permutation_function_key_scratch client_shuffle_permutation_key_x_scratch_2 = client_shuffle_permutation_key_x < outer_server_mutual_shuffle_permutation_function_key_scratch
# line 144 # line 144
# Outer Function Function Key Scratch = Outer (Mutual) Function Function Ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied # Outer Function Function Key Scratch = Outer (Mutual) Function Function ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied
outer_function_function_key_scratch = outer_mutual_function_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied outer_function_function_key_scratch = outer_mutual_function_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied
# Inner (Mutual) Function Key Client Scratch = Inner (Mutual) Function Applied Key < Outer Function Function Key Scratch # Inner (Mutual) Function Key Client Scratch = Inner (Mutual) Function Applied Key < Outer Function Function Key Scratch
@@ -764,20 +764,20 @@ if __name__ == "__main__":
# (Mutual) Function Key Scratch 2 = Inner (Mutual) Function Key Client Scratch << client_shuffle_permutation_key_x_scratch_2 # (Mutual) Function Key Scratch 2 = Inner (Mutual) Function Key Client Scratch << client_shuffle_permutation_key_x_scratch_2
mutual_function_key_scratch_2 = inner_mutual_function_key_client_scratch << client_shuffle_permutation_key_x_scratch_2 mutual_function_key_scratch_2 = inner_mutual_function_key_client_scratch << client_shuffle_permutation_key_x_scratch_2
# Outer (Mutual) Function Key Scratch = Outer (Mutual) Function Ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied # Outer (Mutual) Function Key Scratch = Outer (Mutual) Function ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied
outer_mutual_function_key_scratch = outer_mutual_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied outer_mutual_function_key_scratch = outer_mutual_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied
# Client (Substitution) Key B Scratch = Client (Substitution) Key < Outer (Mutual) Function Key Scratch # Client (Substitution) Key B Scratch = Client (Substitution) Key < Outer (Mutual) Function Key Scratch
client_substitution_key_b_scratch = client_substitution_key < outer_mutual_function_key_scratch client_substitution_key_b_scratch = client_substitution_key < outer_mutual_function_key_scratch
# Client (Substitution) Ephemeral Key B Scratch = Client (Substitution) Ephemeral Key < Outer (Mutual) Function Key Scratch # Client (Substitution) ephemeral Key B Scratch = Client (Substitution) ephemeral Key < Outer (Mutual) Function Key Scratch
client_substitution_ephemeral_key_b_scratch = client_substitution_ephemeral_key < outer_mutual_function_key_scratch client_substitution_ephemeral_key_b_scratch = client_substitution_ephemeral_key < outer_mutual_function_key_scratch
# Shared (Mutual) (Substitution) Ephemeral Key Client Scratch = Shared (Mutual) (Substitution) Ephemeral Key < Outer (Mutual) Function Key Scratch # Shared (Mutual) (Substitution) ephemeral Key Client Scratch = Shared (Mutual) (Substitution) ephemeral Key < Outer (Mutual) Function Key Scratch
shared_mutual_substitution_ephemeral_key_client_scratch = shared_mutual_substitution_ephemeral_key < outer_mutual_function_key_scratch shared_mutual_substitution_ephemeral_key_client_scratch = shared_mutual_substitution_ephemeral_key < outer_mutual_function_key_scratch
# Shared (Mutual) (Substitution) Ephemeral Key Client Scratch # Shared (Mutual) (Substitution) ephemeral Key Client Scratch
# DARC Message Data TODO: unsure how to compute this # DARC Message Data TODO: unsure how to compute this
# DARC Message Data Check = DARC Message Data < Alphabet Input Sequence Scratch # DARC Message Data Check = DARC Message Data < Alphabet Input Sequence Scratch
@@ -786,11 +786,11 @@ if __name__ == "__main__":
""" Server Rx (Phase 4) """ """ Server Rx (Phase 4) """
""" """
Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) Ephemeral Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Ephemeral Key Server Scratch << Inner Function Key Scratch 2) Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) ephemeral Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) ephemeral Key Server Scratch << Inner Function Key Scratch 2)
=BITXOR( =BITXOR(
Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) Ephemeral Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) ephemeral Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2)
BITXOR( BITXOR(
Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) Ephemeral Key Scratch << Inner Function Key Scratch 2) Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) ephemeral Key Scratch << Inner Function Key Scratch 2)
BITXOR( BITXOR(
Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2)
BITXOR( BITXOR(
@@ -803,11 +803,11 @@ if __name__ == "__main__":
FALSE FALSE
) )
), ),
Server (Substitution) Ephemeral Key Scratch << Inner Function Key Scratch 2 Server (Substitution) ephemeral Key Scratch << Inner Function Key Scratch 2
HLOOKUP( HLOOKUP(
BN184, # Inner Function Key Scratch 2 BN184, # Inner Function Key Scratch 2
INDIRECT(ADDRESS(@CELL("row", $BD$5), @CELL("col", BN$5) - BN$5) & ":" & ADDRESS(@CELL("row", $BB$242), @CELL("col", BN$5) - BN$5 + $E$2 - 1)), INDIRECT(ADDRESS(@CELL("row", $BD$5), @CELL("col", BN$5) - BN$5) & ":" & ADDRESS(@CELL("row", $BB$242), @CELL("col", BN$5) - BN$5 + $E$2 - 1)),
ROW($BB201) - ROW($BD$5) + 1, # Server (Substitution) Ephemeral Key Scratch ROW($BB201) - ROW($BD$5) + 1, # Server (Substitution) ephemeral Key Scratch
FALSE FALSE
) )
), ),
@@ -819,33 +819,33 @@ if __name__ == "__main__":
FALSE FALSE
) )
), ),
(Shared (Mutual) (Substitution) Ephemeral Key Server Scratch << Inner Function Key Scratch 2) (Shared (Mutual) (Substitution) ephemeral Key Server Scratch << Inner Function Key Scratch 2)
HLOOKUP( HLOOKUP(
BN184, # Inner Function Key Scratch 2 BN184, # Inner Function Key Scratch 2
INDIRECT(ADDRESS(@CELL("row", $BD$5), @CELL("col", BN$5) - BN$5) & ":" & ADDRESS(@CELL("row", $BB$242), @CELL("col", BN$5) - BN$5 + $E$2 - 1)), INDIRECT(ADDRESS(@CELL("row", $BD$5), @CELL("col", BN$5) - BN$5) & ":" & ADDRESS(@CELL("row", $BB$242), @CELL("col", BN$5) - BN$5 + $E$2 - 1)),
ROW($BB203) - ROW($BD$5) + 1, # Shared (Mutual) (Substitution) Ephemeral Key Server Scratch ROW($BB203) - ROW($BD$5) + 1, # Shared (Mutual) (Substitution) ephemeral Key Server Scratch
FALSE FALSE
) )
) )
""" """
# Translation (Substitution) = Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) Ephemeral Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Ephemeral Key Server Scratch << Inner Function Key Scratch 2) # Translation (Substitution) = Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) ephemeral Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) ephemeral Key Server Scratch << Inner Function Key Scratch 2)
translation_substitution = alphabet_scratch_2 ^ (server_substitution_key_scratch << inner_function_key_scratch_2) ^ (server_substitution_ephemeral_key_scratch << inner_function_key_scratch_2) ^ (shared_mutual_substitution_key_scratch << inner_function_key_scratch_2) ^ (shared_mutual_substitution_ephemeral_key_server_scratch << inner_function_key_scratch_2) translation_substitution = alphabet_scratch_2 ^ (server_substitution_key_scratch << inner_function_key_scratch_2) ^ (server_substitution_ephemeral_key_scratch << inner_function_key_scratch_2) ^ (shared_mutual_substitution_key_scratch << inner_function_key_scratch_2) ^ (shared_mutual_substitution_ephemeral_key_server_scratch << inner_function_key_scratch_2)
""" Final """ """ Final """
""" Server Tx (Phase 1) """ """ Server Tx (Phase 1) """
# Outer Shuffle (Permutation) = Alphabet Values << Outer Server Shuffle (Permutation) Ephemeral Key Applied # Outer Shuffle (Permutation) = Alphabet Values << Outer Server Shuffle (Permutation) ephemeral Key Applied
outer_shuffle_permutation = alphabet_values < outer_server_shuffle_permutation_ephemeral_key_applied outer_shuffle_permutation = alphabet_values < outer_server_shuffle_permutation_ephemeral_key_applied
# Inner Shuffle (Permutation) = Outer Shuffle (Permutation) << Outer Server Shuffle (Permutation) Key Applied # Inner Shuffle (Permutation) = Outer Shuffle (Permutation) << Outer Server Shuffle (Permutation) Key Applied
inner_shuffle_permutation = outer_shuffle_permutation << outer_server_shuffle_permutation_key_applied inner_shuffle_permutation = outer_shuffle_permutation << outer_server_shuffle_permutation_key_applied
""" """
# Inner Shuffle (Permutation) ^ (Server (Substitution) Ephemeral Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Server (Substitution) Key Scratch 2 << Inner (Mutual) Function Key Scratch) # Inner Shuffle (Permutation) ^ (Server (Substitution) ephemeral Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Server (Substitution) Key Scratch 2 << Inner (Mutual) Function Key Scratch)
=BITXOR( =BITXOR(
# Inner Shuffle (Permutation) ^ (Server (Substitution) Ephemeral Key Scratch << Inner (Mutual) Function Key Scratch) # Inner Shuffle (Permutation) ^ (Server (Substitution) ephemeral Key Scratch << Inner (Mutual) Function Key Scratch)
BITXOR( BITXOR(
# Inner Shuffle (Permutation) # Inner Shuffle (Permutation)
@INDIRECT( @INDIRECT(
@@ -856,7 +856,7 @@ if __name__ == "__main__":
1 1
) )
), ),
# Server (Substitution) Ephemeral Key Scratch << Inner (Mutual) Function Key Scratch # Server (Substitution) ephemeral Key Scratch << Inner (Mutual) Function Key Scratch
HLOOKUP( HLOOKUP(
BN107, # Inner (Mutual) Function Key Scratch BN107, # Inner (Mutual) Function Key Scratch
INDIRECT( INDIRECT(
@@ -868,7 +868,7 @@ if __name__ == "__main__":
@CELL("col", BN$5) - BN$5 + $E$2 - 1 @CELL("col", BN$5) - BN$5 + $E$2 - 1
) )
), ),
@ROW($BB103) - ROW($BD$5) + 1, # Server (Substitution) Ephemeral Key Scratch @ROW($BB103) - ROW($BD$5) + 1, # Server (Substitution) ephemeral Key Scratch
FALSE FALSE
) )
), ),
@@ -889,12 +889,12 @@ if __name__ == "__main__":
) )
) )
""" """
# Translation (Substitution) = Inner Shuffle (Permutation) ^ (Server (Substitution) Ephemeral Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Server (Substitution) Key Scratch 2 << Inner (Mutual) Function Key Scratch) # Translation (Substitution) = Inner Shuffle (Permutation) ^ (Server (Substitution) ephemeral Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Server (Substitution) Key Scratch 2 << Inner (Mutual) Function Key Scratch)
translation_substitution = inner_shuffle_permutation ^ (server_substitution_ephemeral_key_scratch << inner_mutual_function_key_scratch) ^ (server_substitution_key_scratch_2 << inner_mutual_function_key_scratch) translation_substitution = inner_shuffle_permutation ^ (server_substitution_ephemeral_key_scratch << inner_mutual_function_key_scratch) ^ (server_substitution_key_scratch_2 << inner_mutual_function_key_scratch)
""" Client Rx (Phase 2) """ """ Client Rx (Phase 2) """
""" """
# Translation (Substitution) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Key A Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Ephemeral Key A Scratch << Inner (Mutual) Function Key Scratch) # Translation (Substitution) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Key A Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) ephemeral Key A Scratch << Inner (Mutual) Function Key Scratch)
=BITXOR( =BITXOR(
# Translation (Substitution) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Key A Scratch << Inner (Mutual) Function Key Scratch) # Translation (Substitution) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Key A Scratch << Inner (Mutual) Function Key Scratch)
BITXOR( BITXOR(
@@ -933,7 +933,7 @@ if __name__ == "__main__":
FALSE FALSE
) )
), ),
Client (Substitution) Ephemeral Key A Scratch << Inner (Mutual) Function Key Scratch Client (Substitution) ephemeral Key A Scratch << Inner (Mutual) Function Key Scratch
HLOOKUP( HLOOKUP(
BN111, # Inner (Mutual) Function Key Scratch BN111, # Inner (Mutual) Function Key Scratch
INDIRECT( INDIRECT(
@@ -945,13 +945,13 @@ if __name__ == "__main__":
@CELL("col", BN$5) - BN$5 + $E$2 - 1 @CELL("col", BN$5) - BN$5 + $E$2 - 1
) )
), ),
ROW($BB114) - ROW($BD$5) + 1, # Client (Substitution) Ephemeral Key A Scratch ROW($BB114) - ROW($BD$5) + 1, # Client (Substitution) ephemeral Key A Scratch
FALSE FALSE
) )
) )
""" """
# Translation (Substitution) - Client Data = Translation (Substitution) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Key A Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Ephemeral Key A Scratch << Inner (Mutual) Function Key Scratch) # Translation (Substitution) - Client Data = Translation (Substitution) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Key A Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) ephemeral Key A Scratch << Inner (Mutual) Function Key Scratch)
translation_substitution_client_data = translation_substitution ^ (shared_mutual_substitution_key_scratch << inner_mutual_function_key_scratch) ^ (client_substitution_key_a_scratch << inner_mutual_function_key_scratch) ^ (client_substitution_ephemeral_key_a_scratch << inner_mutual_function_key_scratch) translation_substitution_client_data = translation_substitution ^ (shared_mutual_substitution_key_scratch << inner_mutual_function_key_scratch) ^ (client_substitution_key_a_scratch << inner_mutual_function_key_scratch) ^ (client_substitution_ephemeral_key_a_scratch << inner_mutual_function_key_scratch)
# Inner Shuffle (Permutation) - CSKA+CSEKA = Translation (Substitution) - Client Data << Client Shuffle (Permutation) Key A Scratch (remove A) # Inner Shuffle (Permutation) - CSKA+CSEKA = Translation (Substitution) - Client Data << Client Shuffle (Permutation) Key A Scratch (remove A)
@@ -964,9 +964,9 @@ if __name__ == "__main__":
inner_shuffle_permutation_csekb_cskb = outer_shuffle_permutation_client_rest << client_shuffle_permutation_key_b_scratch inner_shuffle_permutation_csekb_cskb = outer_shuffle_permutation_client_rest << client_shuffle_permutation_key_b_scratch
""" """
# Inner Shuffle (Permutation) - CSEKB +CSKB ^ (Client (Substitution) Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Client (Substitution) Ephemeral Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Ephemeral Key Client Scratch << (Mutual) Function Key Scratch 2) # Inner Shuffle (Permutation) - CSEKB +CSKB ^ (Client (Substitution) Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Client (Substitution) ephemeral Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) ephemeral Key Client Scratch << (Mutual) Function Key Scratch 2)
=BITXOR( =BITXOR(
# Inner Shuffle (Permutation) - CSEKB +CSKB ^ (Client (Substitution) Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Client (Substitution) Ephemeral Key B Scratch << (Mutual) Function Key Scratch 2) # Inner Shuffle (Permutation) - CSEKB +CSKB ^ (Client (Substitution) Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Client (Substitution) ephemeral Key B Scratch << (Mutual) Function Key Scratch 2)
BITXOR( BITXOR(
# Inner Shuffle (Permutation) - CSEKB +CSKB ^ (Client (Substitution) Key B Scratch << (Mutual) Function Key Scratch 2) # Inner Shuffle (Permutation) - CSEKB +CSKB ^ (Client (Substitution) Key B Scratch << (Mutual) Function Key Scratch 2)
BITXOR( BITXOR(
@@ -987,7 +987,7 @@ if __name__ == "__main__":
FALSE FALSE
) )
), ),
# Client (Substitution) Ephemeral Key B Scratch << (Mutual) Function Key Scratch 2 # Client (Substitution) ephemeral Key B Scratch << (Mutual) Function Key Scratch 2
HLOOKUP( HLOOKUP(
BN147, # (Mutual) Function Key Scratch 2 BN147, # (Mutual) Function Key Scratch 2
INDIRECT( INDIRECT(
@@ -999,11 +999,11 @@ if __name__ == "__main__":
@CELL("col", BN$5) - BN$5 + $E$2 - 1 @CELL("col", BN$5) - BN$5 + $E$2 - 1
) )
), ),
ROW($BB151) - ROW($BD$5) + 1, # Client (Substitution) Ephemeral Key B Scratch ROW($BB151) - ROW($BD$5) + 1, # Client (Substitution) ephemeral Key B Scratch
FALSE FALSE
) )
), ),
# Shared (Mutual) (Substitution) Ephemeral Key Client Scratch << (Mutual) Function Key Scratch 2 # Shared (Mutual) (Substitution) ephemeral Key Client Scratch << (Mutual) Function Key Scratch 2
HLOOKUP( HLOOKUP(
BN147, # (Mutual) Function Key Scratch 2 BN147, # (Mutual) Function Key Scratch 2
INDIRECT( INDIRECT(
@@ -1015,12 +1015,12 @@ if __name__ == "__main__":
@CELL("col", BN$5) - BN$5 + $E$2 - 1 @CELL("col", BN$5) - BN$5 + $E$2 - 1
) )
), ),
ROW($BB152) - ROW($BD$5) + 1, # Shared (Mutual) (Substitution) Ephemeral Key Client Scratch ROW($BB152) - ROW($BD$5) + 1, # Shared (Mutual) (Substitution) ephemeral Key Client Scratch
FALSE FALSE
) )
) )
""" """
# Translation (Substitution) DARC Data = Inner Shuffle (Permutation) - CSEKB +CSKB ^ (Client (Substitution) Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Client (Substitution) Ephemeral Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Ephemeral Key Client Scratch << (Mutual) Function Key Scratch 2) # Translation (Substitution) DARC Data = Inner Shuffle (Permutation) - CSEKB +CSKB ^ (Client (Substitution) Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Client (Substitution) ephemeral Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) ephemeral Key Client Scratch << (Mutual) Function Key Scratch 2)
translation_substitution_darc_data = inner_shuffle_permutation_csekb_cskb ^ (client_substitution_key_b_scratch << mutual_function_key_scratch_2) ^ (client_substitution_ephemeral_key_b_scratch << mutual_function_key_scratch_2) ^ (shared_mutual_substitution_ephemeral_key_client_scratch << mutual_function_key_scratch_2) translation_substitution_darc_data = inner_shuffle_permutation_csekb_cskb ^ (client_substitution_key_b_scratch << mutual_function_key_scratch_2) ^ (client_substitution_ephemeral_key_b_scratch << mutual_function_key_scratch_2) ^ (shared_mutual_substitution_ephemeral_key_client_scratch << mutual_function_key_scratch_2)
a = 1 a = 1
""" Server Rx (Phase 4) """ """ Server Rx (Phase 4) """

View File

@@ -20,32 +20,32 @@ if __name__ == "__main__":
# 7 Outer Server Shuffle (Permutation) Key # 7 Outer Server Shuffle (Permutation) Key
outer_server_shuffle_permutation_key = DarcKey(matrix=[['4', '9', '6', '0', '7', '5', '3', '1', '2', '8']], key_type=DarcKeyTypes.outer_shuffle) outer_server_shuffle_permutation_key = DarcKey(matrix=[['4', '9', '6', '0', '7', '5', '3', '1', '2', '8']], key_type=DarcKeyTypes.outer_shuffle)
# 15 Outer (Mutual) (Substitution) Function Ephemeral Key # 15 Outer (Mutual) (Substitution) Function ephemeral Key
outer_mutual_substitution_function_ephemeral_key = DarcKey(matrix=[ outer_mutual_substitution_function_ephemeral_key = DarcKey(matrix=[
['0', '9', '6', '2', '1', '5', '3', '8', '7', '4'] ['0', '9', '6', '2', '1', '5', '3', '8', '7', '4']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
# 16 Outer (Mutual) (Substitution) Function Function Ephemeral Key # 16 Outer (Mutual) (Substitution) Function Function ephemeral Key
outer_mutual_substitution_function_function_ephemeral_key = DarcKey(matrix=[ outer_mutual_substitution_function_function_ephemeral_key = DarcKey(matrix=[
['2', '3', '9', '7', '6', '0', '1', '4', '8', '5'] ['2', '3', '9', '7', '6', '0', '1', '4', '8', '5']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
# 17 Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key # 17 Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key
outer_server_mutual_shuffle_permutation_function_ephemeral_key = DarcKey(matrix=[ outer_server_mutual_shuffle_permutation_function_ephemeral_key = DarcKey(matrix=[
['0', '8', '5', '9', '7', '3', '1', '4', '6', '2'] ['0', '8', '5', '9', '7', '3', '1', '4', '6', '2']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
# 18 Outer Client Shuffle (Permutation) Ephemeral Key # 18 Outer Client Shuffle (Permutation) ephemeral Key
outer_client_shuffle_permutation_ephemeral_key = DarcKey(matrix=[ outer_client_shuffle_permutation_ephemeral_key = DarcKey(matrix=[
['1', '4', '2', '9', '5', '7', '8', '3', '0', '6'] ['1', '4', '2', '9', '5', '7', '8', '3', '0', '6']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
# 19 Outer Client Shuffle (Permutation) Function Ephemeral Key # 19 Outer Client Shuffle (Permutation) Function ephemeral Key
outer_client_shuffle_permutation_function_ephemeral_key = DarcKey(matrix=[ outer_client_shuffle_permutation_function_ephemeral_key = DarcKey(matrix=[
['4', '3', '2', '5', '1', '6', '7', '8', '0', '9'] ['4', '3', '2', '5', '1', '6', '7', '8', '0', '9']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
# 20 Outer Server Shuffle (Permutation) Ephemeral Key # 20 Outer Server Shuffle (Permutation) ephemeral Key
outer_server_shuffle_permutation_ephemeral_key = DarcKey(matrix=[ outer_server_shuffle_permutation_ephemeral_key = DarcKey(matrix=[
['7', '5', '2', '1', '8', '4', '3', '6', '9', '0'] ['7', '5', '2', '1', '8', '4', '3', '6', '9', '0']
], key_type=DarcKeyTypes.outer_shuffle) ], key_type=DarcKeyTypes.outer_shuffle)
@@ -127,7 +127,7 @@ if __name__ == "__main__":
# 21 (Mutual) (Substitution) Function Ephemeral Key # 21 (Mutual) (Substitution) Function ephemeral Key
mutual_substitution_function_ephemeral_key = DarcKey(matrix=[ mutual_substitution_function_ephemeral_key = DarcKey(matrix=[
['6', '0', '1', '4', '2', '3', '5'], ['6', '0', '1', '4', '2', '3', '5'],
['2', '3', '6', '4', '0', '1', '5'], ['2', '3', '6', '4', '0', '1', '5'],
@@ -141,7 +141,7 @@ if __name__ == "__main__":
['1', '6', '4', '3', '5', '2', '0'] ['1', '6', '4', '3', '5', '2', '0']
], key_type=DarcKeyTypes.inner_shuffle) ], key_type=DarcKeyTypes.inner_shuffle)
# 22 Client Shuffle (Permutation) Ephemeral Key A (remove A) # 22 Client Shuffle (Permutation) ephemeral Key A (remove A)
client_shuffle_permutation_ephemeral_key_a = DarcKey(matrix=[ client_shuffle_permutation_ephemeral_key_a = DarcKey(matrix=[
['5', '0', '4', '3', '2', '6', '1'], ['5', '0', '4', '3', '2', '6', '1'],
['0', '6', '2', '1', '5', '3', '4'], ['0', '6', '2', '1', '5', '3', '4'],
@@ -155,7 +155,7 @@ if __name__ == "__main__":
['4', '6', '2', '3', '5', '1', '0'] ['4', '6', '2', '3', '5', '1', '0']
], key_type=DarcKeyTypes.inner_shuffle) ], key_type=DarcKeyTypes.inner_shuffle)
# 23 Server Shuffle (Permutation) Ephemeral Key 1 (remove 1) # 23 Server Shuffle (Permutation) ephemeral Key 1 (remove 1)
server_shuffle_permutation_ephemeral_key_1 = DarcKey(matrix=[ server_shuffle_permutation_ephemeral_key_1 = DarcKey(matrix=[
['6', '1', '3', '0', '4', '2', '5'], ['6', '1', '3', '0', '4', '2', '5'],
['3', '2', '1', '0', '4', '5', '6'], ['3', '2', '1', '0', '4', '5', '6'],
@@ -214,10 +214,10 @@ if __name__ == "__main__":
key_type=DarcKeyTypes.alphabet key_type=DarcKeyTypes.alphabet
) )
# 24 Server (Substitution) Ephemeral Unique Component Function # 24 Server (Substitution) ephemeral Unique Component Function
server_substitution_ephemeral_unique_component_function = 5 server_substitution_ephemeral_unique_component_function = 5
# 25 Shared (Mutual) (Substitution) Ephemeral Key # 25 Shared (Mutual) (Substitution) ephemeral Key
shared_mutual_substitution_ephemeral_key = DarcKey(matrix=[ shared_mutual_substitution_ephemeral_key = DarcKey(matrix=[
['106', '113', '9', '54', '49', '4', '207'], ['106', '113', '9', '54', '49', '4', '207'],
['184', '3', '232', '179', '15', '113', '142'], ['184', '3', '232', '179', '15', '113', '142'],
@@ -231,7 +231,7 @@ if __name__ == "__main__":
['7', '194', '254', '76', '0', '244', '215'] ['7', '194', '254', '76', '0', '244', '215']
], key_type=DarcKeyTypes.alphabet) ], key_type=DarcKeyTypes.alphabet)
# 26 Client (Substitution) Ephemeral Key # 26 Client (Substitution) ephemeral Key
client_substitution_ephemeral_key = DarcKey(matrix=[ client_substitution_ephemeral_key = DarcKey(matrix=[
['21', '149', '75', '73', '228', '81', '79'], ['21', '149', '75', '73', '228', '81', '79'],
['41', '189', '80', '209', '45', '101', '53'], ['41', '189', '80', '209', '45', '101', '53'],
@@ -245,7 +245,7 @@ if __name__ == "__main__":
['158', '184', '137', '0', '221', '12', '217'] ['158', '184', '137', '0', '221', '12', '217']
], key_type=DarcKeyTypes.alphabet) ], key_type=DarcKeyTypes.alphabet)
# 27 Server (Substitution) Ephemeral Random Component # 27 Server (Substitution) ephemeral Random Component
server_substitution_ephemeral_random_component = DarcKey(matrix=[ server_substitution_ephemeral_random_component = DarcKey(matrix=[
['191', '50', '229', '60', '201', '64', '45'], ['191', '50', '229', '60', '201', '64', '45'],
['31', '88', '90', '8', '153', '6', '228'], ['31', '88', '90', '8', '153', '6', '228'],
@@ -259,7 +259,7 @@ if __name__ == "__main__":
['79', '124', '128', '30', '74', '242', '85'] ['79', '124', '128', '30', '74', '242', '85']
], key_type=DarcKeyTypes.alphabet) ], key_type=DarcKeyTypes.alphabet)
# 28 Server (Substitution) Ephemeral Unique Component # 28 Server (Substitution) ephemeral Unique Component
server_substitution_ephemeral_unique_component = DarcKey(matrix=[ server_substitution_ephemeral_unique_component = DarcKey(matrix=[
['7', '190', '58', '75', '135', '15', '214', '149', '244', '224'] ['7', '190', '58', '75', '135', '15', '214', '149', '244', '224']
], key_type=DarcKeyTypes.alphabet) ], key_type=DarcKeyTypes.alphabet)
@@ -267,34 +267,34 @@ if __name__ == "__main__":
# 30 Shared (Mutual) (Substitution) Key # 30 Shared (Mutual) (Substitution) Key
shared_mutual_substitution_key = shared_mutual_substitution_component_1 ^ client_substitution_key shared_mutual_substitution_key = shared_mutual_substitution_component_1 ^ client_substitution_key
# 31 Outer (Mutual) Function Function Ephemeral Key Applied = Outer (Mutual) (Substitution) Function Function Key << Outer (Mutual) (Substitution) Function Function Ephemeral Key # 31 Outer (Mutual) Function Function ephemeral Key Applied = Outer (Mutual) (Substitution) Function Function Key << Outer (Mutual) (Substitution) Function Function ephemeral Key
outer_mutual_function_function_ephemeral_key_applied = outer_mutual_substitution_function_function_key << outer_mutual_substitution_function_function_ephemeral_key outer_mutual_function_function_ephemeral_key_applied = outer_mutual_substitution_function_function_key << outer_mutual_substitution_function_function_ephemeral_key
# 32 Inner (Mutual) Function Applied Key = (Mutual) (Substitution) Function Key << (Mutual) (Substitution) Function Ephemeral Key # 32 Inner (Mutual) Function Applied Key = (Mutual) (Substitution) Function Key << (Mutual) (Substitution) Function ephemeral Key
inner_mutual_function_applied_key = mutual_substitution_function_key << mutual_substitution_function_ephemeral_key inner_mutual_function_applied_key = mutual_substitution_function_key << mutual_substitution_function_ephemeral_key
# 33 Inner (Mutual) Function Key Scratch = Inner (Mutual) Function Applied Key << Outer (Mutual) Function Function Ephemeral Key Applied # 33 Inner (Mutual) Function Key Scratch = Inner (Mutual) Function Applied Key << Outer (Mutual) Function Function ephemeral Key Applied
inner_mutual_function_key_scratch = inner_mutual_function_applied_key < outer_mutual_function_function_ephemeral_key_applied inner_mutual_function_key_scratch = inner_mutual_function_applied_key < outer_mutual_function_function_ephemeral_key_applied
# 34 Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied = Outer Server (Mutual) Shuffle (Permutation) Function Key << Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key # 34 Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied = Outer Server (Mutual) Shuffle (Permutation) Function Key << Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key
outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied = outer_mutual_shuffle_permutation_function_key << outer_server_mutual_shuffle_permutation_function_ephemeral_key outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied = outer_mutual_shuffle_permutation_function_key << outer_server_mutual_shuffle_permutation_function_ephemeral_key
# 35 Client Shuffle (Permutation) Key X Scratch = Client Shuffle (Permutation) Key X < Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied # 35 Client Shuffle (Permutation) Key X Scratch = Client Shuffle (Permutation) Key X < Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied
client_shuffle_permutation_key_x_scratch = client_shuffle_permutation_key_x < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied client_shuffle_permutation_key_x_scratch = client_shuffle_permutation_key_x < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied
# 36 Inner Function Key Scratch 2 = Inner (Mutual) Function Key Scratch << Client Shuffle (Permutation) Key X Scratch # 36 Inner Function Key Scratch 2 = Inner (Mutual) Function Key Scratch << Client Shuffle (Permutation) Key X Scratch
inner_function_key_scratch_2 = inner_mutual_function_key_scratch << client_shuffle_permutation_key_x_scratch inner_function_key_scratch_2 = inner_mutual_function_key_scratch << client_shuffle_permutation_key_x_scratch
# 37 Outer (Mutual) Function Ephemeral Key Applied = Outer (Mutual) (Substitution) Function Key < Outer (Mutual) (Substitution) Function Ephemeral Key # 37 Outer (Mutual) Function ephemeral Key Applied = Outer (Mutual) (Substitution) Function Key < Outer (Mutual) (Substitution) Function ephemeral Key
outer_mutual_function_ephemeral_key_applied = outer_mutual_substitution_function_key << outer_mutual_substitution_function_ephemeral_key outer_mutual_function_ephemeral_key_applied = outer_mutual_substitution_function_key << outer_mutual_substitution_function_ephemeral_key
# 38 Server (Substitution) Key Scratch = Server (Substitution) Key < Outer (Mutual) Function Ephemeral Key Applied # 38 Server (Substitution) Key Scratch = Server (Substitution) Key < Outer (Mutual) Function ephemeral Key Applied
server_substitution_key_scratch = server_substitution_key < outer_mutual_function_ephemeral_key_applied server_substitution_key_scratch = server_substitution_key < outer_mutual_function_ephemeral_key_applied
# 39 Shared (Mutual) (Substitution) Key Scratch = Shared (Mutual) (Substitution) Key < Outer (Mutual) Function Ephemeral Key Applied # 39 Shared (Mutual) (Substitution) Key Scratch = Shared (Mutual) (Substitution) Key < Outer (Mutual) Function ephemeral Key Applied
shared_mutual_substitution_key_scratch = shared_mutual_substitution_key < outer_mutual_function_ephemeral_key_applied shared_mutual_substitution_key_scratch = shared_mutual_substitution_key < outer_mutual_function_ephemeral_key_applied
# 40 Shared (Mutual) (Substitution) Ephemeral Key Server Scratch = Shared (Mutual) (Substitution) Ephemeral Key < Outer (Mutual) Function Ephemeral Key Applied # 40 Shared (Mutual) (Substitution) ephemeral Key Server Scratch = Shared (Mutual) (Substitution) ephemeral Key < Outer (Mutual) Function ephemeral Key Applied
shared_mutual_substitution_ephemeral_key_server_scratch = shared_mutual_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied shared_mutual_substitution_ephemeral_key_server_scratch = shared_mutual_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied
# line 78 # line 78
@@ -304,71 +304,71 @@ if __name__ == "__main__":
# 42 Server Client Shuffle (Permutation) Inverse # 42 Server Client Shuffle (Permutation) Inverse
server_client_shuffle_permutation_inverse = ~server_client_shuffle_permutation server_client_shuffle_permutation_inverse = ~server_client_shuffle_permutation
# 43 Server Shuffle (Permutation) Ephemeral Key 1 Inverse (remove 1) = ~(Server Shuffle (Permutation) Ephemeral Key 1 (remove 1)) # 43 Server Shuffle (Permutation) ephemeral Key 1 Inverse (remove 1) = ~(Server Shuffle (Permutation) ephemeral Key 1 (remove 1))
server_shuffle_permutation_ephemeral_key_1_inverse = ~server_shuffle_permutation_ephemeral_key_1 server_shuffle_permutation_ephemeral_key_1_inverse = ~server_shuffle_permutation_ephemeral_key_1
# 44 Server Shuffle (Permutation) Ephemeral Key Applied = Server Client Shuffle (Permutation) Inverse < Server Shuffle (Permutation) Ephemeral Key 1 Inverse (remove 1) # 44 Server Shuffle (Permutation) ephemeral Key Applied = Server Client Shuffle (Permutation) Inverse < Server Shuffle (Permutation) ephemeral Key 1 Inverse (remove 1)
server_shuffle_permutation_ephemeral_key_applied = server_client_shuffle_permutation_inverse << server_shuffle_permutation_ephemeral_key_1_inverse server_shuffle_permutation_ephemeral_key_applied = server_client_shuffle_permutation_inverse << server_shuffle_permutation_ephemeral_key_1_inverse
# line 82 # line 82
# 45 Server Shuffle (Permutation) Ephemeral Key Applied Scratch = Server Shuffle (Permutation) Ephemeral Key Applied < Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied # 45 Server Shuffle (Permutation) ephemeral Key Applied Scratch = Server Shuffle (Permutation) ephemeral Key Applied < Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied
server_shuffle_permutation_ephemeral_key_applied_scratch = server_shuffle_permutation_ephemeral_key_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied server_shuffle_permutation_ephemeral_key_applied_scratch = server_shuffle_permutation_ephemeral_key_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied
# 46 Server Shuffle (Permutation) Ephemeral Key Applied Scratch Inverse = ~Server Shuffle (Permutation) Ephemeral Key Applied Scratch # 46 Server Shuffle (Permutation) ephemeral Key Applied Scratch Inverse = ~Server Shuffle (Permutation) ephemeral Key Applied Scratch
server_shuffle_permutation_ephemeral_key_applied_scratch_inverse = ~server_shuffle_permutation_ephemeral_key_applied_scratch server_shuffle_permutation_ephemeral_key_applied_scratch_inverse = ~server_shuffle_permutation_ephemeral_key_applied_scratch
# 47 Outer Server Shuffle (Permutation) Ephemeral Key Applied = Outer Server Shuffle (Permutation) Key < Outer Server Shuffle (Permutation) Ephemeral Key # 47 Outer Server Shuffle (Permutation) ephemeral Key Applied = Outer Server Shuffle (Permutation) Key < Outer Server Shuffle (Permutation) ephemeral Key
outer_server_shuffle_permutation_ephemeral_key_applied = outer_server_shuffle_permutation_key << outer_server_shuffle_permutation_ephemeral_key outer_server_shuffle_permutation_ephemeral_key_applied = outer_server_shuffle_permutation_key << outer_server_shuffle_permutation_ephemeral_key
# 48 Alphabet Scratch 1 = Alphabet Values < Outer Server Shuffle (Permutation) Ephemeral Key Applied # 48 Alphabet Scratch 1 = Alphabet Values < Outer Server Shuffle (Permutation) ephemeral Key Applied
alphabet_scratch_1 = alphabet_values < outer_server_shuffle_permutation_ephemeral_key_applied alphabet_scratch_1 = alphabet_values < outer_server_shuffle_permutation_ephemeral_key_applied
# 49 Alphabet Scratch 2 = Alphabet Scratch 1 << Server Shuffle (Permutation) Ephemeral Key Applied Scratch Inverse # 49 Alphabet Scratch 2 = Alphabet Scratch 1 << Server Shuffle (Permutation) ephemeral Key Applied Scratch Inverse
alphabet_scratch_2 = alphabet_scratch_1 << server_shuffle_permutation_ephemeral_key_applied_scratch_inverse alphabet_scratch_2 = alphabet_scratch_1 << server_shuffle_permutation_ephemeral_key_applied_scratch_inverse
# 50 Server (Substitution) Ephemeral Component Scratch 1 = Server (Substitution) Ephemeral Random Component.column_substitution( Server (Substitution) Ephemeral Unique Component Function ,Server (Substitution) Ephemeral Unique Component) # 50 Server (Substitution) ephemeral Component Scratch 1 = Server (Substitution) ephemeral Random Component.column_substitution( Server (Substitution) ephemeral Unique Component Function ,Server (Substitution) ephemeral Unique Component)
server_substitution_ephemeral_component_scratch_1 = server_substitution_ephemeral_random_component.column_substitution( server_substitution_ephemeral_component_scratch_1 = server_substitution_ephemeral_random_component.column_substitution(
server_substitution_ephemeral_unique_component_function, server_substitution_ephemeral_unique_component_function,
server_substitution_ephemeral_unique_component.matrix[0] server_substitution_ephemeral_unique_component.matrix[0]
) )
# 51 Server (Substitution) Ephemeral Component Scratch 2 = Server (Substitution) Ephemeral Component Scratch 1 < Outer (Mutual) Function Ephemeral Key Applied # 51 Server (Substitution) ephemeral Component Scratch 2 = Server (Substitution) ephemeral Component Scratch 1 < Outer (Mutual) Function ephemeral Key Applied
server_substitution_ephemeral_component_scratch_2 = server_substitution_ephemeral_component_scratch_1 < outer_mutual_function_ephemeral_key_applied server_substitution_ephemeral_component_scratch_2 = server_substitution_ephemeral_component_scratch_1 < outer_mutual_function_ephemeral_key_applied
# 52 Server (Substitution) Ephemeral Component Scratch 3 = Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) Ephemeral Component Scratch 2 << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Ephemeral Key Server Scratch << Inner Function Key Scratch 2) # 52 Server (Substitution) ephemeral Component Scratch 3 = Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) ephemeral Component Scratch 2 << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) ephemeral Key Server Scratch << Inner Function Key Scratch 2)
server_substitution_ephemeral_component_scratch_3 = alphabet_scratch_2 ^ (server_substitution_key_scratch << inner_function_key_scratch_2) ^ (server_substitution_ephemeral_component_scratch_2 << inner_function_key_scratch_2) ^ (shared_mutual_substitution_key_scratch << inner_function_key_scratch_2) ^ (shared_mutual_substitution_ephemeral_key_server_scratch << inner_function_key_scratch_2) server_substitution_ephemeral_component_scratch_3 = alphabet_scratch_2 ^ (server_substitution_key_scratch << inner_function_key_scratch_2) ^ (server_substitution_ephemeral_component_scratch_2 << inner_function_key_scratch_2) ^ (shared_mutual_substitution_key_scratch << inner_function_key_scratch_2) ^ (shared_mutual_substitution_ephemeral_key_server_scratch << inner_function_key_scratch_2)
# 52 Inner Function Key Scratch 2 Inverse = ~Inner Function Key Scratch 2 # 52 Inner Function Key Scratch 2 Inverse = ~Inner Function Key Scratch 2
inner_function_key_scratch_2_inverse = ~inner_function_key_scratch_2 inner_function_key_scratch_2_inverse = ~inner_function_key_scratch_2
# 54 Server (Substitution) Ephemeral Key Scratch = Server (Substitution) Ephemeral Component Scratch 3 << Inner Function Key Scratch 2 Inverse # 54 Server (Substitution) ephemeral Key Scratch = Server (Substitution) ephemeral Component Scratch 3 << Inner Function Key Scratch 2 Inverse
server_substitution_ephemeral_key_scratch = server_substitution_ephemeral_component_scratch_3 << inner_function_key_scratch_2_inverse server_substitution_ephemeral_key_scratch = server_substitution_ephemeral_component_scratch_3 << inner_function_key_scratch_2_inverse
# 55 Outer (Mutual) Function Ephemeral Key Applied Inverse = ~Outer (Mutual) Function Ephemeral Key Applied # 55 Outer (Mutual) Function ephemeral Key Applied Inverse = ~Outer (Mutual) Function ephemeral Key Applied
outer_mutual_function_ephemeral_key_applied_inverse = ~outer_mutual_function_ephemeral_key_applied outer_mutual_function_ephemeral_key_applied_inverse = ~outer_mutual_function_ephemeral_key_applied
# 56 Server (Substitution) Ephemeral Key = Server (Substitution) Ephemeral Key Scratch < Outer (Mutual) Function Ephemeral Key Applied Inverse # 56 Server (Substitution) ephemeral Key = Server (Substitution) ephemeral Key Scratch < Outer (Mutual) Function ephemeral Key Applied Inverse
server_substitution_ephemeral_key = server_substitution_ephemeral_key_scratch < outer_mutual_function_ephemeral_key_applied_inverse server_substitution_ephemeral_key = server_substitution_ephemeral_key_scratch < outer_mutual_function_ephemeral_key_applied_inverse
# line 94 # line 94
""" Server Tx (Phase 1) """ """ Server Tx (Phase 1) """
# 57 Inner Server Shuffle (Permutation) Key Applied = Server Shuffle (Permutation) Ephemeral Key 1 (remove 1) << Server Shuffle (Permutation) Key # 57 Inner Server Shuffle (Permutation) Key Applied = Server Shuffle (Permutation) ephemeral Key 1 (remove 1) << Server Shuffle (Permutation) Key
inner_server_shuffle_permutation_key_applied = server_shuffle_permutation_ephemeral_key_1 << server_shuffle_permutation_key inner_server_shuffle_permutation_key_applied = server_shuffle_permutation_ephemeral_key_1 << server_shuffle_permutation_key
# 58 Outer Server Shuffle (Permutation) Key Applied = Inner Server Shuffle (Permutation) Key Applied < Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied # 58 Outer Server Shuffle (Permutation) Key Applied = Inner Server Shuffle (Permutation) Key Applied < Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied
outer_server_shuffle_permutation_key_applied = inner_server_shuffle_permutation_key_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied outer_server_shuffle_permutation_key_applied = inner_server_shuffle_permutation_key_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied
# 59 Server (Substitution) Ephemeral Key Scratch = Server (Substitution) Ephemeral Key < Outer (Mutual) Function Ephemeral Key Applied # 59 Server (Substitution) ephemeral Key Scratch = Server (Substitution) ephemeral Key < Outer (Mutual) Function ephemeral Key Applied
server_substitution_ephemeral_key_scratch = server_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied server_substitution_ephemeral_key_scratch = server_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied
# 86 Outer Shuffle (Permutation) = Alphabet Values << Outer Server Shuffle (Permutation) Ephemeral Key Applied # 86 Outer Shuffle (Permutation) = Alphabet Values << Outer Server Shuffle (Permutation) ephemeral Key Applied
#outer_shuffle_permutation = alphabet_values < outer_server_shuffle_permutation_ephemeral_key_applied #outer_shuffle_permutation = alphabet_values < outer_server_shuffle_permutation_ephemeral_key_applied
## 87 Inner Shuffle (Permutation) = Outer Shuffle (Permutation) << Outer Server Shuffle (Permutation) Key Applied ## 87 Inner Shuffle (Permutation) = Outer Shuffle (Permutation) << Outer Server Shuffle (Permutation) Key Applied
#inner_shuffle_permutation = outer_shuffle_permutation << outer_server_shuffle_permutation_key_applied #inner_shuffle_permutation = outer_shuffle_permutation << outer_server_shuffle_permutation_key_applied
## 88 Translation (Substitution) = Inner Shuffle (Permutation) ^ (Server (Substitution) Ephemeral Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Server (Substitution) Key Scratch << Inner (Mutual) Function Key Scratch) ## 88 Translation (Substitution) = Inner Shuffle (Permutation) ^ (Server (Substitution) ephemeral Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Server (Substitution) Key Scratch << Inner (Mutual) Function Key Scratch)
#translation_substitution = inner_shuffle_permutation ^ ( #translation_substitution = inner_shuffle_permutation ^ (
# server_substitution_ephemeral_key_scratch << inner_mutual_function_key_scratch) ^ ( # server_substitution_ephemeral_key_scratch << inner_mutual_function_key_scratch) ^ (
# server_substitution_key_scratch << inner_mutual_function_key_scratch) # server_substitution_key_scratch << inner_mutual_function_key_scratch)
@@ -376,25 +376,25 @@ if __name__ == "__main__":
# line 108 # line 108
""" Client Rx (Phase 2) """ """ Client Rx (Phase 2) """
# 62 Client (Substitution) Key A Scratch = Client (Substitution) Key < Outer (Mutual) Function Ephemeral Key Applied # 62 Client (Substitution) Key A Scratch = Client (Substitution) Key < Outer (Mutual) Function ephemeral Key Applied
client_substitution_key_a_scratch = client_substitution_key < outer_mutual_function_ephemeral_key_applied client_substitution_key_a_scratch = client_substitution_key < outer_mutual_function_ephemeral_key_applied
# 63 Client (Substitution) Ephemeral Key A Scratch = Client (Substitution) Ephemeral Key < Outer (Mutual) Function Ephemeral Key Applied # 63 Client (Substitution) ephemeral Key A Scratch = Client (Substitution) ephemeral Key < Outer (Mutual) Function ephemeral Key Applied
client_substitution_ephemeral_key_a_scratch = client_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied client_substitution_ephemeral_key_a_scratch = client_substitution_ephemeral_key < outer_mutual_function_ephemeral_key_applied
# 64 Client Shuffle (Permutation) Key A Applied (remove A) = Client Shuffle (Permutation) Key A Applied (remove A) << Client Shuffle (Permutation) Ephemeral Key A (remove A) # 64 Client Shuffle (Permutation) Key A Applied (remove A) = Client Shuffle (Permutation) Key A Applied (remove A) << Client Shuffle (Permutation) ephemeral Key A (remove A)
client_shuffle_permutation_key_a_applied = client_shuffle_permutation_key_a << client_shuffle_permutation_ephemeral_key_a client_shuffle_permutation_key_a_applied = client_shuffle_permutation_key_a << client_shuffle_permutation_ephemeral_key_a
# 65 Client Shuffle (Permutation) Key A Scratch (remove A) = Client Shuffle (Permutation) Key A Applied (remove A) < Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied # 65 Client Shuffle (Permutation) Key A Scratch (remove A) = Client Shuffle (Permutation) Key A Applied (remove A) < Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied
client_shuffle_permutation_key_a_scratch = client_shuffle_permutation_key_a_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied client_shuffle_permutation_key_a_scratch = client_shuffle_permutation_key_a_applied < outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied
# 66 Outer Client Shuffle (Permutation) Ephemeral Key Applied = Outer Client Shuffle (Permutation) Key << Outer Client Shuffle (Permutation) Ephemeral Key # 66 Outer Client Shuffle (Permutation) ephemeral Key Applied = Outer Client Shuffle (Permutation) Key << Outer Client Shuffle (Permutation) ephemeral Key
outer_client_shuffle_permutation_ephemeral_key_applied = outer_client_shuffle_permutation_key << outer_client_shuffle_permutation_ephemeral_key outer_client_shuffle_permutation_ephemeral_key_applied = outer_client_shuffle_permutation_key << outer_client_shuffle_permutation_ephemeral_key
# 67 Outer Client Shuffle (Permutation) Function Ephemeral Key Applied = Outer Client Shuffle (Permutation) Function Key << Outer Client Shuffle (Permutation) Function Ephemeral Key # 67 Outer Client Shuffle (Permutation) Function ephemeral Key Applied = Outer Client Shuffle (Permutation) Function Key << Outer Client Shuffle (Permutation) Function ephemeral Key
outer_client_shuffle_permutation_function_ephemeral_key_applied = outer_client_shuffle_permutation_function_key << outer_client_shuffle_permutation_function_ephemeral_key outer_client_shuffle_permutation_function_ephemeral_key_applied = outer_client_shuffle_permutation_function_key << outer_client_shuffle_permutation_function_ephemeral_key
# 68 Outer Client Shuffle (Permutation) Function Key Applied = Outer Client Shuffle (Permutation) Ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Ephemeral Key Applied # 68 Outer Client Shuffle (Permutation) Function Key Applied = Outer Client Shuffle (Permutation) ephemeral Key Applied << Outer Client Shuffle (Permutation) Function ephemeral Key Applied
outer_client_shuffle_permutation_function_key_applied = outer_client_shuffle_permutation_ephemeral_key_applied << outer_client_shuffle_permutation_function_ephemeral_key_applied outer_client_shuffle_permutation_function_key_applied = outer_client_shuffle_permutation_ephemeral_key_applied << outer_client_shuffle_permutation_function_ephemeral_key_applied
# 69 Outer Client Shuffle (Permutation) Function Key Applied Inverse = ~Outer Client Shuffle (Permutation) Function Key Applied # 69 Outer Client Shuffle (Permutation) Function Key Applied Inverse = ~Outer Client Shuffle (Permutation) Function Key Applied
@@ -403,7 +403,7 @@ if __name__ == "__main__":
# 70 Alphabet Input Sequence Scratch = Outer Client Shuffle (Permutation) Function Key Applied Inverse << Alphabet Input Sequence # 70 Alphabet Input Sequence Scratch = Outer Client Shuffle (Permutation) Function Key Applied Inverse << Alphabet Input Sequence
alphabet_input_sequence_scratch = outer_client_shuffle_permutation_function_key_applied_inverse << alphabet_input_sequence alphabet_input_sequence_scratch = outer_client_shuffle_permutation_function_key_applied_inverse << alphabet_input_sequence
# 89 Translation (Substitution) - Client Data = Translation (Substitution) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Key A Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Ephemeral Key A Scratch << Inner (Mutual) Function Key Scratch) # 89 Translation (Substitution) - Client Data = Translation (Substitution) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) Key A Scratch << Inner (Mutual) Function Key Scratch) ^ (Client (Substitution) ephemeral Key A Scratch << Inner (Mutual) Function Key Scratch)
#translation_substitution_client_data = translation_substitution ^ ( #translation_substitution_client_data = translation_substitution ^ (
# shared_mutual_substitution_key_scratch << inner_mutual_function_key_scratch) ^ ( # shared_mutual_substitution_key_scratch << inner_mutual_function_key_scratch) ^ (
# client_substitution_key_a_scratch << inner_mutual_function_key_scratch) ^ ( # client_substitution_key_a_scratch << inner_mutual_function_key_scratch) ^ (
@@ -424,13 +424,13 @@ if __name__ == "__main__":
# 72 Client Shuffle (Permutation) Key B (remove B) = Client Shuffle (Permutation) Key A Inverse (remove A) << Client Shuffle (Permutation) Key X # 72 Client Shuffle (Permutation) Key B (remove B) = Client Shuffle (Permutation) Key A Inverse (remove A) << Client Shuffle (Permutation) Key X
client_shuffle_permutation_key_b = client_shuffle_permutation_key_a_inverse << client_shuffle_permutation_key_x client_shuffle_permutation_key_b = client_shuffle_permutation_key_a_inverse << client_shuffle_permutation_key_x
# 73 Client Shuffle (Permutation) Ephemeral Key A (remove A) Inverse = ~Client Shuffle (Permutation) Ephemeral Key A (remove A) # 73 Client Shuffle (Permutation) ephemeral Key A (remove A) Inverse = ~Client Shuffle (Permutation) ephemeral Key A (remove A)
client_shuffle_permutation_ephemeral_key_a_inverse = ~client_shuffle_permutation_ephemeral_key_a client_shuffle_permutation_ephemeral_key_a_inverse = ~client_shuffle_permutation_ephemeral_key_a
# 74 Client Shuffle (Permutation) Key B Applied = Client Shuffle (Permutation) Ephemeral Key B << Client Shuffle (Permutation) Key B (remove B) # 74 Client Shuffle (Permutation) Key B Applied = Client Shuffle (Permutation) ephemeral Key B << Client Shuffle (Permutation) Key B (remove B)
client_shuffle_permutation_key_b_applied = client_shuffle_permutation_ephemeral_key_a_inverse << client_shuffle_permutation_key_b client_shuffle_permutation_key_b_applied = client_shuffle_permutation_ephemeral_key_a_inverse << client_shuffle_permutation_key_b
# 75 Outer Server (Mutual) Shuffle (Permutation) Function Key Scratch = Outer Server (Mutual) Shuffle (Permutation) Function Ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied # 75 Outer Server (Mutual) Shuffle (Permutation) Function Key Scratch = Outer Server (Mutual) Shuffle (Permutation) Function ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied
outer_server_mutual_shuffle_permutation_function_key_scratch = outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied outer_server_mutual_shuffle_permutation_function_key_scratch = outer_server_mutual_shuffle_permutation_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied
# 76 Client Shuffle (Permutation) Key B Scratch = Client Shuffle (Permutation) Key B Applied < Outer Server (Mutual) Shuffle (Permutation) Function Key Scratch # 76 Client Shuffle (Permutation) Key B Scratch = Client Shuffle (Permutation) Key B Applied < Outer Server (Mutual) Shuffle (Permutation) Function Key Scratch
@@ -440,7 +440,7 @@ if __name__ == "__main__":
client_shuffle_permutation_key_x_scratch_2 = client_shuffle_permutation_key_x < outer_server_mutual_shuffle_permutation_function_key_scratch client_shuffle_permutation_key_x_scratch_2 = client_shuffle_permutation_key_x < outer_server_mutual_shuffle_permutation_function_key_scratch
# line 144 # line 144
# 78 Outer Function Function Key Scratch = Outer (Mutual) Function Function Ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied # 78 Outer Function Function Key Scratch = Outer (Mutual) Function Function ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied
outer_function_function_key_scratch = outer_mutual_function_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied outer_function_function_key_scratch = outer_mutual_function_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied
# 79 Inner (Mutual) Function Key Client Scratch = Inner (Mutual) Function Applied Key < Outer Function Function Key Scratch # 79 Inner (Mutual) Function Key Client Scratch = Inner (Mutual) Function Applied Key < Outer Function Function Key Scratch
@@ -450,22 +450,22 @@ if __name__ == "__main__":
# 80 (Mutual) Function Key Scratch 2 = Inner (Mutual) Function Key Client Scratch << client_shuffle_permutation_key_x_scratch_2 # 80 (Mutual) Function Key Scratch 2 = Inner (Mutual) Function Key Client Scratch << client_shuffle_permutation_key_x_scratch_2
mutual_function_key_scratch_2 = inner_mutual_function_key_client_scratch << client_shuffle_permutation_key_x_scratch_2 mutual_function_key_scratch_2 = inner_mutual_function_key_client_scratch << client_shuffle_permutation_key_x_scratch_2
# 81 Outer (Mutual) Function Key Scratch = Outer (Mutual) Function Ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied # 81 Outer (Mutual) Function Key Scratch = Outer (Mutual) Function ephemeral Key Applied << Outer Client Shuffle (Permutation) Function Key Applied
outer_mutual_function_key_scratch = outer_mutual_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied outer_mutual_function_key_scratch = outer_mutual_function_ephemeral_key_applied << outer_client_shuffle_permutation_function_key_applied
# 82 Client (Substitution) Key B Scratch = Client (Substitution) Key < Outer (Mutual) Function Key Scratch # 82 Client (Substitution) Key B Scratch = Client (Substitution) Key < Outer (Mutual) Function Key Scratch
client_substitution_key_b_scratch = client_substitution_key < outer_mutual_function_key_scratch client_substitution_key_b_scratch = client_substitution_key < outer_mutual_function_key_scratch
# 83 Client (Substitution) Ephemeral Key B Scratch = Client (Substitution) Ephemeral Key < Outer (Mutual) Function Key Scratch # 83 Client (Substitution) ephemeral Key B Scratch = Client (Substitution) ephemeral Key < Outer (Mutual) Function Key Scratch
client_substitution_ephemeral_key_b_scratch = client_substitution_ephemeral_key < outer_mutual_function_key_scratch client_substitution_ephemeral_key_b_scratch = client_substitution_ephemeral_key < outer_mutual_function_key_scratch
# 84 Shared (Mutual) (Substitution) Ephemeral Key Client Scratch = Shared (Mutual) (Substitution) Ephemeral Key < Outer (Mutual) Function Key Scratch # 84 Shared (Mutual) (Substitution) ephemeral Key Client Scratch = Shared (Mutual) (Substitution) ephemeral Key < Outer (Mutual) Function Key Scratch
shared_mutual_substitution_ephemeral_key_client_scratch = shared_mutual_substitution_ephemeral_key < outer_mutual_function_key_scratch shared_mutual_substitution_ephemeral_key_client_scratch = shared_mutual_substitution_ephemeral_key < outer_mutual_function_key_scratch
# 92 Inner Shuffle (Permutation) - CSEKB +CSKB = Outer Shuffle (Permutation) - Client Rest << Client Shuffle (Permutation) Key B Scratch # 92 Inner Shuffle (Permutation) - CSEKB +CSKB = Outer Shuffle (Permutation) - Client Rest << Client Shuffle (Permutation) Key B Scratch
#inner_shuffle_permutation_csekb_cskb = outer_shuffle_permutation_client_rest << client_shuffle_permutation_key_b_scratch #inner_shuffle_permutation_csekb_cskb = outer_shuffle_permutation_client_rest << client_shuffle_permutation_key_b_scratch
## 93 Translation (Substitution) DARC Data = Inner Shuffle (Permutation) - CSEKB +CSKB ^ (Client (Substitution) Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Client (Substitution) Ephemeral Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Ephemeral Key Client Scratch << (Mutual) Function Key Scratch 2) ## 93 Translation (Substitution) DARC Data = Inner Shuffle (Permutation) - CSEKB +CSKB ^ (Client (Substitution) Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Client (Substitution) ephemeral Key B Scratch << (Mutual) Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) ephemeral Key Client Scratch << (Mutual) Function Key Scratch 2)
#translation_substitution_darc_data = inner_shuffle_permutation_csekb_cskb ^ ( #translation_substitution_darc_data = inner_shuffle_permutation_csekb_cskb ^ (
# client_substitution_key_b_scratch << mutual_function_key_scratch_2) ^ ( # client_substitution_key_b_scratch << mutual_function_key_scratch_2) ^ (
# client_substitution_ephemeral_key_b_scratch << mutual_function_key_scratch_2) ^ ( # client_substitution_ephemeral_key_b_scratch << mutual_function_key_scratch_2) ^ (
@@ -474,7 +474,7 @@ if __name__ == "__main__":
# line 175 # line 175
""" Server Rx (Phase 4) """ """ Server Rx (Phase 4) """
# 85 Translation (Substitution) = Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) Ephemeral Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Ephemeral Key Server Scratch << Inner Function Key Scratch 2) # 85 Translation (Substitution) = Alphabet Scratch 2 ^ (Server (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Server (Substitution) ephemeral Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) Key Scratch << Inner Function Key Scratch 2) ^ (Shared (Mutual) (Substitution) ephemeral Key Server Scratch << Inner Function Key Scratch 2)
translation_substitution = ( translation_substitution = (
alphabet_scratch_2 ^ alphabet_scratch_2 ^
(server_substitution_key_scratch << inner_function_key_scratch_2) ^ (server_substitution_key_scratch << inner_function_key_scratch_2) ^

View File

@@ -146,306 +146,319 @@ class AlphabetKey(DarcKey):
class ClientEphemeralDataKeys(BaseModel): class ClientEphemeralDataKeys(BaseModel):
OuterClientShuffleEphemeralKey: OuterShuffleKey outer_key_1: OuterShuffleKey
OuterClientShuffleFunctionEphemeralKey: OuterShuffleKey outer_key_2: OuterShuffleKey
ClientEphemeralKey: AlphabetKey alpha_key_1: AlphabetKey
ClientShuffleEphemeralKeyA: InnerShuffleKey inner_key_1: InnerShuffleKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ClientEphemeralDataKeys( return ClientEphemeralDataKeys(
OuterClientShuffleEphemeralKey=OuterShuffleKey.init_matrix(height), outer_key_1=OuterShuffleKey.init_matrix(height),
OuterClientShuffleFunctionEphemeralKey=OuterShuffleKey.init_matrix(height), outer_key_2=OuterShuffleKey.init_matrix(height),
ClientEphemeralKey=AlphabetKey.init_matrix(width, height, 255), alpha_key_1=AlphabetKey.init_matrix(width, height, 255),
ClientShuffleEphemeralKeyA=InnerShuffleKey.init_matrix(width, height), inner_key_1=InnerShuffleKey.init_matrix(width, height),
) )
class ClientEphemeralMediumKeys(BaseModel): class ClientEphemeralMediumKeys(BaseModel):
OuterClientShuffleMediumEphemeralKey: OuterShuffleKey outer_key_1: OuterShuffleKey
OuterClientShuffleFunctionMediumEphemeralKey: OuterShuffleKey outer_key_2: OuterShuffleKey
ClientShuffleMediumEphemeralKeyA: InnerShuffleKey inner_key_1: InnerShuffleKey
ClientMediumEphemeralKey: AlphabetKey alpha_key_1: AlphabetKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ClientEphemeralMediumKeys( return ClientEphemeralMediumKeys(
OuterClientShuffleMediumEphemeralKey=OuterShuffleKey.init_matrix(height), outer_key_1=OuterShuffleKey.init_matrix(height),
OuterClientShuffleFunctionMediumEphemeralKey=OuterShuffleKey.init_matrix(height), outer_key_2=OuterShuffleKey.init_matrix(height),
ClientShuffleMediumEphemeralKeyA=InnerShuffleKey.init_matrix(width, height), inner_key_1=InnerShuffleKey.init_matrix(width, height),
ClientMediumEphemeralKey=AlphabetKey.init_matrix(width, height, 255) alpha_key_1=AlphabetKey.init_matrix(width, height, 255)
) )
class ClientPersistentDataKeys(BaseModel): class ClientPersistentDataKeys(BaseModel):
ClientKey: AlphabetKey alpha_key_1: AlphabetKey
ClientShuffleKeyA: InnerShuffleKey inner_key_1: InnerShuffleKey
OuterClientShuffleKey: OuterShuffleKey outer_key_1: OuterShuffleKey
OuterClientShuffleFunctionKey: OuterShuffleKey outer_key_2: OuterShuffleKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ClientPersistentDataKeys( return ClientPersistentDataKeys(
ClientKey=AlphabetKey.init_matrix(width, height, 255), alpha_key_1=AlphabetKey.init_matrix(width, height, 255),
ClientShuffleKeyA=InnerShuffleKey.init_matrix(width, height), inner_key_1=InnerShuffleKey.init_matrix(width, height),
OuterClientShuffleKey=OuterShuffleKey.init_matrix(height), outer_key_1=OuterShuffleKey.init_matrix(height),
OuterClientShuffleFunctionKey=OuterShuffleKey.init_matrix(height), outer_key_2=OuterShuffleKey.init_matrix(height),
) )
class ClientPersistentMediumKeys(BaseModel): class ClientPersistentMediumKeys(BaseModel):
OuterClientShuffleMediumKey: OuterShuffleKey outer_key_1: OuterShuffleKey
OuterClientShuffleFunctionMediumKey: OuterShuffleKey outer_key_2: OuterShuffleKey
ClientShuffleMediumKeyA: InnerShuffleKey inner_key_1: InnerShuffleKey
ClientMediumKey: AlphabetKey alpha_key_1: AlphabetKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ClientPersistentMediumKeys( return ClientPersistentMediumKeys(
OuterClientShuffleMediumKey=OuterShuffleKey.init_matrix(height), outer_key_1=OuterShuffleKey.init_matrix(height),
OuterClientShuffleFunctionMediumKey=OuterShuffleKey.init_matrix(height), outer_key_2=OuterShuffleKey.init_matrix(height),
ClientShuffleMediumKeyA=InnerShuffleKey.init_matrix(width, height), inner_key_1=InnerShuffleKey.init_matrix(width, height),
ClientMediumKey=AlphabetKey.init_matrix(width, height, 255) alpha_key_1=AlphabetKey.init_matrix(width, height, 255)
) )
class ServerEphemeralDataKeys(BaseModel): class ServerEphemeralDataKeys(BaseModel):
OuterServerShuffleEphemeralKey: OuterShuffleKey outer_key_1: OuterShuffleKey
ServerEphemeralKey: AlphabetKey alpha_key_1: AlphabetKey
ServerShuffleEphemeralKey: InnerShuffleKey inner_key_1: InnerShuffleKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ServerEphemeralDataKeys( return ServerEphemeralDataKeys(
OuterServerShuffleEphemeralKey=OuterShuffleKey.init_matrix(height), outer_key_1=OuterShuffleKey.init_matrix(height),
ServerEphemeralKey=AlphabetKey.init_matrix(width, height, 255), alpha_key_1=AlphabetKey.init_matrix(width, height, 255),
ServerShuffleEphemeralKey=InnerShuffleKey.init_matrix(width, height), inner_key_1=InnerShuffleKey.init_matrix(width, height),
) )
class ServerEphemeralMediumKeys(BaseModel): class ServerEphemeralMediumKeys(BaseModel):
ServerMediumEphemeralKey: AlphabetKey alpha_key_1: AlphabetKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ServerEphemeralMediumKeys( return ServerEphemeralMediumKeys(
ServerMediumEphemeralKey=AlphabetKey.init_matrix(width, height, 255) alpha_key_1=AlphabetKey.init_matrix(width, height, 255)
) )
class ServerPersistentDataKeys(BaseModel): class ServerPersistentDataKeys(BaseModel):
OuterServerShuffleKey: OuterShuffleKey outer_key_1: OuterShuffleKey
ServerKey: AlphabetKey alpha_key_1: AlphabetKey
ServerShuffleKey: InnerShuffleKey inner_key_1: InnerShuffleKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ServerPersistentDataKeys( return ServerPersistentDataKeys(
OuterServerShuffleKey=OuterShuffleKey.init_matrix(height), outer_key_1=OuterShuffleKey.init_matrix(height),
ServerKey=AlphabetKey.init_matrix(width, height, 255), alpha_key_1=AlphabetKey.init_matrix(width, height, 255),
ServerShuffleKey=InnerShuffleKey.init_matrix(width, height), inner_key_1=InnerShuffleKey.init_matrix(width, height),
) )
class ServerPersistentMediumKeys(BaseModel): class ServerPersistentMediumKeys(BaseModel):
ServerMediumKey: AlphabetKey alpha_key_1: AlphabetKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ServerPersistentMediumKeys( return ServerPersistentMediumKeys(
ServerMediumKey=AlphabetKey.init_matrix(width, height, 255) alpha_key_1=AlphabetKey.init_matrix(width, height, 255)
) )
class MutualEphemeralDataKeys(BaseModel): class MutualEphemeralDataKeys(BaseModel):
MutualKey: AlphabetKey alpha_key_1: AlphabetKey
Inner1: InnerShuffleKey inner_key_1: InnerShuffleKey
OuterFunctionKey: OuterShuffleKey outer_key_1: OuterShuffleKey
OuterFunctionFunctionKey: OuterShuffleKey outer_key_2: OuterShuffleKey
OuterServerShuffleFunctionKey: OuterShuffleKey outer_key_3: OuterShuffleKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return MutualEphemeralDataKeys( return MutualEphemeralDataKeys(
MutualKey=AlphabetKey.init_matrix(width, height, 255), alpha_key_1=AlphabetKey.init_matrix(width, height, 255),
Inner1=InnerShuffleKey.init_matrix(width, height), inner_key_1=InnerShuffleKey.init_matrix(width, height),
OuterFunctionKey=OuterShuffleKey.init_matrix(height), outer_key_1=OuterShuffleKey.init_matrix(height),
OuterFunctionFunctionKey=OuterShuffleKey.init_matrix(height), outer_key_2=OuterShuffleKey.init_matrix(height),
OuterServerShuffleFunctionKey=OuterShuffleKey.init_matrix(height), outer_key_3=OuterShuffleKey.init_matrix(height),
) )
class MutualEphemeralMediumKeys(BaseModel): class MutualEphemeralMediumKeys(BaseModel):
MutualMediumKey: AlphabetKey alpha_key_1: AlphabetKey
FunctionMediumKey: InnerShuffleKey
PositionFunctionMediumEphemeralKey: InnerShuffleKey outer_key_1: OuterShuffleKey
OuterFunctionMediumEphemeralKey: OuterShuffleKey outer_key_2: OuterShuffleKey
OuterFunctionFunctionMediumEphemeralKey: OuterShuffleKey outer_key_3: OuterShuffleKey
OuterPositionFunctionMediumEphemeralKey: OuterShuffleKey outer_key_4: OuterShuffleKey
OuterServerShuffleFunctionMediumEphemeralKey: OuterShuffleKey outer_key_5: OuterShuffleKey
OuterPositionShuffleFunctionMediumEphemeralKey: OuterShuffleKey outer_key_6: OuterShuffleKey
PositionShuffleMediumEphemeralKey: InnerShuffleKey
OuterPositionShuffleMediumEphemeralKey: OuterShuffleKey inner_key_1: InnerShuffleKey
inner_key_2: InnerShuffleKey
inner_key_3: InnerShuffleKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return MutualEphemeralMediumKeys( return MutualEphemeralMediumKeys(
MutualMediumKey=AlphabetKey.init_matrix(width, height, 255), alpha_key_1=AlphabetKey.init_matrix(width, height, 255),
FunctionMediumKey=InnerShuffleKey.init_matrix(width, height), outer_key_1=OuterShuffleKey.init_matrix(height),
PositionFunctionMediumEphemeralKey=InnerShuffleKey.init_matrix(width, height), outer_key_2=OuterShuffleKey.init_matrix(height),
OuterFunctionMediumEphemeralKey=OuterShuffleKey.init_matrix(height), outer_key_3=OuterShuffleKey.init_matrix(height),
OuterFunctionFunctionMediumEphemeralKey=OuterShuffleKey.init_matrix(height), outer_key_4=OuterShuffleKey.init_matrix(height),
OuterPositionFunctionMediumEphemeralKey=OuterShuffleKey.init_matrix(height), outer_key_5=OuterShuffleKey.init_matrix(height),
OuterServerShuffleFunctionMediumEphemeralKey=OuterShuffleKey.init_matrix(height), outer_key_6=OuterShuffleKey.init_matrix(height),
OuterPositionShuffleFunctionMediumEphemeralKey=OuterShuffleKey.init_matrix(height), inner_key_1=InnerShuffleKey.init_matrix(width, height),
PositionShuffleMediumEphemeralKey=InnerShuffleKey.init_matrix(width, height), inner_key_2=InnerShuffleKey.init_matrix(width, height),
OuterPositionShuffleMediumEphemeralKey=OuterShuffleKey.init_matrix(height) inner_key_3=InnerShuffleKey.init_matrix(width, height),
) )
class MutualPersistentDataKeys(BaseModel): class MutualPersistentDataKeys(BaseModel):
OuterFunctionKey: OuterShuffleKey outer_key_1: OuterShuffleKey
OuterFunctionFunctionKey: OuterShuffleKey outer_key_2: OuterShuffleKey
OuterServerShuffleFunctionKey: OuterShuffleKey outer_key_3: OuterShuffleKey
MutualKey: AlphabetKey alpha_key_1: AlphabetKey
Inner1: InnerShuffleKey inner_key_1: InnerShuffleKey
ClientShuffleKeyX: InnerShuffleKey inner_key_2: InnerShuffleKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return MutualPersistentDataKeys( return MutualPersistentDataKeys(
OuterFunctionKey=OuterShuffleKey.init_matrix(height), outer_key_1=OuterShuffleKey.init_matrix(height),
OuterFunctionFunctionKey=OuterShuffleKey.init_matrix(height), outer_key_2=OuterShuffleKey.init_matrix(height),
OuterServerShuffleFunctionKey=OuterShuffleKey.init_matrix(height), outer_key_3=OuterShuffleKey.init_matrix(height),
MutualKey=AlphabetKey.init_matrix(width, height, 255), alpha_key_1=AlphabetKey.init_matrix(width, height, 255),
Inner1=InnerShuffleKey.init_matrix(width, height), inner_key_1=InnerShuffleKey.init_matrix(width, height),
ClientShuffleKeyX=InnerShuffleKey.init_matrix(width, height), inner_key_2=InnerShuffleKey.init_matrix(width, height),
) )
class MutualPersistentMediumKeys(BaseModel): class MutualPersistentMediumKeys(BaseModel):
MutualMediumKey: AlphabetKey alpha_key_1: AlphabetKey
OuterFunctionMediumKey: OuterShuffleKey
OuterFunctionFunctionMediumKey: OuterShuffleKey outer_key_1: OuterShuffleKey
OuterServerShuffleFunctionMediumKey: OuterShuffleKey outer_key_2: OuterShuffleKey
FunctionMediumKey: InnerShuffleKey outer_key_3: OuterShuffleKey
ClientShuffleMediumKeyX: InnerShuffleKey outer_key_4: OuterShuffleKey
OuterPositionShuffleMediumKey: OuterShuffleKey outer_key_5: OuterShuffleKey
OuterPositionShuffleFunctionMediumKey: OuterShuffleKey outer_key_6: OuterShuffleKey
OuterPositionFunctionMediumKey: OuterShuffleKey
PositionFunctionMediumKey: InnerShuffleKey inner_key_1: InnerShuffleKey
PositionShuffleMediumKey: InnerShuffleKey inner_key_2: InnerShuffleKey
inner_key_3: InnerShuffleKey
inner_key_4: InnerShuffleKey
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return MutualPersistentMediumKeys( return MutualPersistentMediumKeys(
MutualMediumKey=AlphabetKey.init_matrix(width, height, 255), alpha_key_1=AlphabetKey.init_matrix(width, height, 255),
OuterFunctionMediumKey=OuterShuffleKey.init_matrix(height), outer_key_1=OuterShuffleKey.init_matrix(height),
OuterFunctionFunctionMediumKey=OuterShuffleKey.init_matrix(height), outer_key_2=OuterShuffleKey.init_matrix(height),
OuterServerShuffleFunctionMediumKey=OuterShuffleKey.init_matrix(height), outer_key_3=OuterShuffleKey.init_matrix(height),
FunctionMediumKey=InnerShuffleKey.init_matrix(width, height), outer_key_4=OuterShuffleKey.init_matrix(height),
ClientShuffleMediumKeyX=InnerShuffleKey.init_matrix(width, height), outer_key_5=OuterShuffleKey.init_matrix(height),
OuterPositionShuffleMediumKey=OuterShuffleKey.init_matrix(height), outer_key_6=OuterShuffleKey.init_matrix(height),
OuterPositionShuffleFunctionMediumKey=OuterShuffleKey.init_matrix(height), inner_key_1=InnerShuffleKey.init_matrix(width, height),
OuterPositionFunctionMediumKey=OuterShuffleKey.init_matrix(height), inner_key_2=InnerShuffleKey.init_matrix(width, height),
PositionFunctionMediumKey=InnerShuffleKey.init_matrix(width, height), inner_key_3=InnerShuffleKey.init_matrix(width, height),
PositionShuffleMediumKey=InnerShuffleKey.init_matrix(width, height), inner_key_4=InnerShuffleKey.init_matrix(width, height),
) )
class ServerPersistentKeys(BaseModel): class ServerPersistentKeys(BaseModel):
Data: ServerPersistentDataKeys data: ServerPersistentDataKeys
Medium: ServerPersistentMediumKeys medium: ServerPersistentMediumKeys
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ServerPersistentKeys( return ServerPersistentKeys(
Data=ServerPersistentDataKeys.random_init(height, width), data=ServerPersistentDataKeys.random_init(height, width),
Medium=ServerPersistentMediumKeys.random_init(height, width) medium=ServerPersistentMediumKeys.random_init(height, width)
) )
class ClientPersistentKeys(BaseModel): class ClientPersistentKeys(BaseModel):
Data: ClientPersistentDataKeys data: ClientPersistentDataKeys
Medium: ClientPersistentMediumKeys medium: ClientPersistentMediumKeys
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ClientPersistentKeys( return ClientPersistentKeys(
Data=ClientPersistentDataKeys.random_init(height, width), data=ClientPersistentDataKeys.random_init(height, width),
Medium=ClientPersistentMediumKeys.random_init(height, width) medium=ClientPersistentMediumKeys.random_init(height, width)
) )
class MutualPersistentKeys(BaseModel): class MutualPersistentKeys(BaseModel):
Data: MutualPersistentDataKeys data: MutualPersistentDataKeys
Medium: MutualPersistentMediumKeys medium: MutualPersistentMediumKeys
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return MutualPersistentKeys( return MutualPersistentKeys(
Data=MutualPersistentDataKeys.random_init(height, width), data=MutualPersistentDataKeys.random_init(height, width),
Medium=MutualPersistentMediumKeys.random_init(height, width) medium=MutualPersistentMediumKeys.random_init(height, width)
) )
class ServerEphemeralKeys(BaseModel): class ServerEphemeralKeys(BaseModel):
Data: ServerEphemeralDataKeys data: ServerEphemeralDataKeys
Medium: ServerEphemeralMediumKeys medium: ServerEphemeralMediumKeys
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ServerEphemeralKeys( return ServerEphemeralKeys(
Data=ServerEphemeralDataKeys.random_init(height, width), data=ServerEphemeralDataKeys.random_init(height, width),
Medium=ServerEphemeralMediumKeys.random_init(height, width) medium=ServerEphemeralMediumKeys.random_init(height, width)
) )
class MutualEphemeralKeys(BaseModel): class MutualEphemeralKeys(BaseModel):
Data: MutualEphemeralDataKeys data: MutualEphemeralDataKeys
Medium: MutualEphemeralMediumKeys medium: MutualEphemeralMediumKeys
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return MutualEphemeralKeys( return MutualEphemeralKeys(
Data=MutualEphemeralDataKeys.random_init(height, width), data=MutualEphemeralDataKeys.random_init(height, width),
Medium=MutualEphemeralMediumKeys.random_init(height, width) medium=MutualEphemeralMediumKeys.random_init(height, width)
) )
class ClientEphemeralKeys(BaseModel): class ClientEphemeralKeys(BaseModel):
Data: ClientEphemeralDataKeys data: ClientEphemeralDataKeys
Medium: ClientEphemeralMediumKeys medium: ClientEphemeralMediumKeys
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ClientEphemeralKeys( return ClientEphemeralKeys(
Data=ClientEphemeralDataKeys.random_init(height, width), data=ClientEphemeralDataKeys.random_init(height, width),
Medium=ClientEphemeralMediumKeys.random_init(height, width) medium=ClientEphemeralMediumKeys.random_init(height, width)
) )
class ServerKeys(BaseModel): class ServerKeys(BaseModel):
Persistent: ServerPersistentKeys persistent: ServerPersistentKeys
Ephemeral: ServerEphemeralKeys ephemeral: ServerEphemeralKeys
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ServerKeys( return ServerKeys(
Persistent=ServerPersistentKeys.random_init(height, width), persistent=ServerPersistentKeys.random_init(height, width),
Ephemeral=ServerEphemeralKeys.random_init(height, width) ephemeral=ServerEphemeralKeys.random_init(height, width)
) )
class MutualKeys(BaseModel): class MutualKeys(BaseModel):
Persistent: MutualPersistentKeys persistent: MutualPersistentKeys
Ephemeral: MutualEphemeralKeys ephemeral: MutualEphemeralKeys
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return MutualKeys( return MutualKeys(
Persistent=MutualPersistentKeys.random_init(height, width), persistent=MutualPersistentKeys.random_init(height, width),
Ephemeral=MutualEphemeralKeys.random_init(height, width) ephemeral=MutualEphemeralKeys.random_init(height, width)
) )
class ClientKeys(BaseModel): class ClientKeys(BaseModel):
Persistent: ClientPersistentKeys persistent: ClientPersistentKeys
Ephemeral: ClientEphemeralKeys ephemeral: ClientEphemeralKeys
@classmethod @classmethod
def random_init(cls, height: int, width: int): def random_init(cls, height: int, width: int):
return ClientKeys( return ClientKeys(
Persistent=ClientPersistentKeys.random_init(height, width), persistent=ClientPersistentKeys.random_init(height, width),
Ephemeral=ClientEphemeralKeys.random_init(height, width) ephemeral=ClientEphemeralKeys.random_init(height, width)
) )