Skip to content

Commit

Permalink
libsignal compatibility update #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Henkes committed Mar 14, 2018
1 parent 520fc7f commit 448ee66
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions x3dh/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ def initSessionActive(self, other_public_bundle, allow_zero_otpks = False):

sk = self.__kdf(dh1 + dh2 + dh3 + dh4)

ad = self.__ik.enc + other_ik.enc
ik_enc_serialized = self.__EncryptionKeyEncoder.encodeEncryptionKey(self.__ik.enc, self.__config.curve)
other_ik_enc_serialized = self.__EncryptionKeyEncoder.encodeEncryptionKey(other_ik.enc, self.__config.curve)

ad = ik_enc_serialized + other_ik_enc_serialized

return {
"to_other": {
Expand Down Expand Up @@ -202,7 +205,10 @@ def initSessionPassive(self, session_init_data, allow_no_otpk = False):

sk = self.__kdf(dh1 + dh2 + dh3 + dh4)

ad = other_ik.enc + self.__ik.enc
other_ik_enc_serialized = self.__EncryptionKeyEncoder.encodeEncryptionKey(other_ik.enc, self.__config.curve)
ik_enc_serialized = self.__EncryptionKeyEncoder.encodeEncryptionKey(self.__ik.enc, self.__config.curve)

ad = other_ik_enc_serialized + ik_enc_serialized

if my_otpk:
self.__otpks.remove(my_otpk)
Expand Down

0 comments on commit 448ee66

Please sign in to comment.