Skip to content

Commit

Permalink
add typing for secure aggregation
Browse files Browse the repository at this point in the history
Signed-off-by: weiwee <wbwmat@gmail.com>
  • Loading branch information
sagewe committed Jul 10, 2023
1 parent 723b84d commit 1086243
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from typing import List, Dict, Optional, Tuple
import numpy as np

class DiffieHellman:
def __init__(self) -> None: ...
def get_public_key(self) -> bytes: ...
def diffie_hellman(self, other_public_key: bytes) -> bytes: ...

class RandomMix:
def __init__(self, seeds: Dict[int, bytes], rank: int) -> None: ...
def mix_one(self, input: np.ndarray, weight: Optional[float] = None) -> Tuple[np.ndarray, np.ndarray]: ...
def mix(self, inputs: List[np.ndarray], weight: Optional[float] = None) -> List[Tuple[np.ndarray, np.ndarray]]: ...
def get_index(self, rank: int) -> int: ...

class MixAggregate:
def __init__(self) -> None: ...
def aggregate(self, inputs: List[Tuple[np.ndarray, np.ndarray]]) -> None: ...
def finalize(self, weight: Optional[float] = None) -> List[np.ndarray]: ...

0 comments on commit 1086243

Please sign in to comment.