Skip to content

Commit

Permalink
Merge branch 'main' into add-node-to-fleet-req
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljanes authored Sep 26, 2024
2 parents 6e22f78 + 3aadc21 commit 561d1ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/py/flwr/common/secure_aggregation/secaggplus_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def share_keys_plaintext_concat(
"""
return b"".join(
[
int.to_bytes(src_node_id, 8, "little", signed=True),
int.to_bytes(dst_node_id, 8, "little", signed=True),
int.to_bytes(src_node_id, 8, "little", signed=False),
int.to_bytes(dst_node_id, 8, "little", signed=False),
int.to_bytes(len(b_share), 4, "little"),
b_share,
sk_share,
Expand Down Expand Up @@ -72,8 +72,8 @@ def share_keys_plaintext_separate(plaintext: bytes) -> tuple[int, int, bytes, by
the secret key share of the source sent to the destination.
"""
src, dst, mark = (
int.from_bytes(plaintext[:8], "little", signed=True),
int.from_bytes(plaintext[8:16], "little", signed=True),
int.from_bytes(plaintext[:8], "little", signed=False),
int.from_bytes(plaintext[8:16], "little", signed=False),
int.from_bytes(plaintext[16:20], "little"),
)
ret = (src, dst, plaintext[20 : 20 + mark], plaintext[20 + mark :])
Expand Down

0 comments on commit 561d1ee

Please sign in to comment.