Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge a98407b into da6ad02
Browse files Browse the repository at this point in the history
  • Loading branch information
kealan committed Aug 6, 2019
2 parents da6ad02 + a98407b commit c93cca4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions wrappers/python/mpin_ZZZ.py.in
Expand Up @@ -55,7 +55,7 @@ extern void KILL_CSPRNG(csprng *R);
extern void OCT_clear(octet *O);
extern void HASH_ID(int h,octet *ID,octet *HID);
extern unsigned int MPIN_ZZZ_GET_TIME(void);
extern unsigned int GET_TIME(void);
extern void MPIN_ZZZ_GET_Y(int h,int t,octet *O,octet *Y);
extern int MPIN_ZZZ_EXTRACT_PIN(int h,octet *ID,int pin,octet *CS);
extern int MPIN_ZZZ_CLIENT(int h,int d,octet *ID,csprng *R,octet *x,int pin,octet *T,octet *V,octet *U,octet *UT,octet *TP, octet* MESSAGE, int t, octet *y);
Expand Down Expand Up @@ -217,7 +217,7 @@ def get_time():
Raises:
"""
return libamcl_mpin_ZZZ.MPIN_ZZZ_GET_TIME()
return libamcl_mpin_ZZZ.GET_TIME()


def create_csprng(seed):
Expand Down Expand Up @@ -968,8 +968,7 @@ def server_2(epoch_date, HID, HTID, y, server_secret, u, ut, v, pa):
return error_code, e_hex.decode("hex"), f_hex.decode("hex")


def server(hash_type, epoch_date, server_secret,
u, ut, v, mpin_id, message, epoch_time, pa):
def server(hash_type, epoch_date, server_secret, u, ut, v, mpin_id, message, epoch_time, pa):
"""Perform server side of the one-pass version of the M-Pin protocol
Perform server side of the one-pass version of the M-Pin protocol. If Time
Expand Down Expand Up @@ -1547,6 +1546,8 @@ if __name__ == "__main__":
# Client MPIN
rtn, x, u, ut, v, y = client(
HASH_TYPE_ZZZ, date, mpin_id, rng, None, PIN, token, time_permit, None, epoch_time)
if DEBUG:
print "y1 ", y.encode("hex")
if rtn != 0:
print "MPIN_ZZZ_CLIENT ERROR %s" % rtn

Expand All @@ -1556,7 +1557,7 @@ if __name__ == "__main__":

# Server MPIN
rtn, HID, HTID, E, F, y2 = server(
HASH_TYPE_ZZZ, date, server_secret, u, ut, v, mpin_id, None, epoch_time)
HASH_TYPE_ZZZ, date, server_secret, u, ut, v, mpin_id, None, epoch_time, None)
if DEBUG:
print "y2 ", y2.encode("hex")
if rtn != 0:
Expand Down Expand Up @@ -1701,8 +1702,6 @@ if __name__ == "__main__":
del cs2
del client_secret
del token
del pc1
del pc2
del x
del u
del ut
Expand All @@ -1729,5 +1728,7 @@ if __name__ == "__main__":
del HM
del client_aes_key
del server_aes_key
del pc1
del pc2

kill_csprng(rng)

0 comments on commit c93cca4

Please sign in to comment.