MCPcopy Create free account
hub / github.com/Huelse/SEAL-Python / linear_transform_plain

Function linear_transform_plain

examples/matrix_operations.py:66–82  ·  view source on GitHub ↗
(cipher_matrix, plain_diags, galois_keys, evaluator)

Source from the content-addressed store, hash-verified

64
65
66def linear_transform_plain(cipher_matrix, plain_diags, galois_keys, evaluator):
67 cipher_rot = evaluator.rotate_vector(cipher_matrix, -len(plain_diags), galois_keys)
68 cipher_temp = evaluator.add(cipher_matrix, cipher_rot)
69 cipher_results = []
70 temp = evaluator.multiply_plain(cipher_temp, plain_diags[0])
71 cipher_results.append(temp)
72
73 i = 1
74 while i < len(plain_diags):
75 temp_rot = evaluator.rotate_vector(cipher_temp, i, galois_keys)
76 temp = evaluator.multiply_plain(temp_rot, plain_diags[i])
77 cipher_results.append(temp)
78 i += 1
79
80 cipher_prime = evaluator.add_many(cipher_results)
81
82 return cipher_prime
83
84
85def get_u_sigma(shape):

Callers 2

matrix_multiplicationFunction · 0.85
matrix_transpose_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected