Skip to content

Commit

Permalink
Add _output_conversion for secfld arrays. Test .codecov.yml PR patch. (
Browse files Browse the repository at this point in the history
  • Loading branch information
lschoe authored May 1, 2024
1 parent 8f8d923 commit 8195bd3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mpyc/sectypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,13 @@ def out_conv(cls, a): # field -> subfield
name = f'Array{secfld.__name__}'
secarray = type(name, (SecureFiniteFieldArray,), {'__slots__': ()})
secarray.sectype = secfld
if secfld.subfield:
@classmethod
def out_conv(cls, a): # field -> subfield
assert np.all(np.vectorize(lambda _: _.degree())(a.value) <= 0)
return secfld.subfield.array(np.vectorize(int)(a), check=False)

secarray._output_conversion = out_conv
globals()[name] = secarray # TODO: check name dynamic type sufficiently unique
secfld.array = secarray
return secfld
Expand Down

0 comments on commit 8195bd3

Please sign in to comment.