Skip to content

Commit fa49097

Browse files
committed
Write cgf2n to socket by converting to regint.
1 parent 4dd834c commit fa49097

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Compiler/types.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,17 @@ class cgf2n(_clear, _gf2n):
13871387
instruction_type = 'gf2n'
13881388
reg_type = 'cg'
13891389

1390+
@classmethod
1391+
def write_to_socket(self, client_id, values,
1392+
message_type=ClientMessageType.NoType):
1393+
""" Send a list of values to a client by converting to 64-bit regint.
1394+
1395+
:param client_id: Client id (regint)
1396+
:param values: list of cgf2n
1397+
1398+
"""
1399+
regint.write_to_socket(client_id, [regint.conv(x) for x in values])
1400+
13901401
@classmethod
13911402
def bit_compose(cls, bits, step=None):
13921403
r""" Clear :math:`\mathrm{GF}(2^n)` bit composition.

0 commit comments

Comments
 (0)