Files

17 lines
460 B
Python
Raw Permalink Normal View History

2026-07-12 14:06:45 +04:00
from core.participant import Participant
from core.public_params import PublicParams
class Bob:
def __init__(self, params: PublicParams, secret: int | None = None):
self.party = Participant(params, secret=secret)
self.shared_key = None
@property
def B(self) -> int:
return self.party.public_value
def receive_A(self, A: int):
self.shared_key = self.party.compute_shared_key(A)
return self.shared_key