theirPrefix :: Relation a -> Word8
theirPrefix relation =
  fromIntegral . ord $ case relation of
                         Asymmetric{us=SideA} -> 'B'
                         Asymmetric{us=SideB} -> 'A'
                         Symmetric{} -> 'S'

-- | Everything required for the SPAKE2 protocol.
--
-- Both sides must agree on these values for the protocol to work.
-- This /mostly/ means value equality, except for 'Relation.us',
-- where each side must have complementary values.
--
-- Construct with 'makeAsymmetricProtocol' or 'makeSymmetricProtocol'.
theirPrefix :: Relation a -> Word8
theirPrefix relation =
  fromIntegral . ord $ case relation of
                         Asymmetric{us=SideA} -> 'B'
                         Asymmetric{us=SideB} -> 'A'
                         Symmetric{} -> 'S'

-- | Everything required for the SPAKE2 protocol.
--
-- Both sides must agree on these values for the protocol to work.
-- This /mostly/ means value equality, except for 'Relation.us',
-- where each side must have complementary values.
--
-- Construct with 'makeAsymmetricProtocol' or 'makeSymmetricProtocol'.
theirPrefix relation =
  fromIntegral . ord $ case relation of
                         Asymmetric{us=SideA} -> 'B'
                         Asymmetric{us=SideB} -> 'A'
                         Symmetric{} -> 'S'

-- | Everything required for the SPAKE2 protocol.
--
-- Both sides must agree on these values for the protocol to work.
-- This /mostly/ means value equality, except for 'Relation.us',
-- where each side must have complementary values.
--
-- Construct with 'makeAsymmetricProtocol' or 'makeSymmetricProtocol'.