Esempio n. 1
0
 def __init__(self, group_obj, assump_size, k, verbose=False):
     ABEnc.__init__(self)
     self.group = group_obj
     self.assump_size = assump_size  # size of linear assumption, at least 2
     self.util = MSP(self.group, verbose)
     self.k = k
     self.index = k
     self.i = 5
     self.j = 5  # we assume i = j, equals to identity-based encryption.
     self.msk = {}
     self.mpk = {}
     self.pk = None
     self.sk = None
     self.sk_delta = None
     self.ID_i = None
     self.ID_j = None
     self.I = []
     for i in range(self.k):
         self.I.append(self.group.random(ZR))
Esempio n. 2
0
 def __init__(self, group_obj, verbose=False):
     ABEnc.__init__(self)
     self.group = group_obj
     self.util = MSP(self.group, verbose)
Esempio n. 3
0
 def __init__(self, group_obj, uni_size, verbose=False):
     ABEnc.__init__(self)
     self.group = group_obj
     self.uni_size = uni_size  # bound on the size of the universe of attributes
     self.util = MSP(self.group, verbose)
def send_waypoint(protocol, params):
    protocol.provide(MSP_SET_WP, params)
    protocol.read_ack(MSP_SET_WP)


if __name__ == '__main__':
    filename = 'waypoints.txt'
    if len(sys.argv) > 1:
        filename = sys.argv[1]

    print('Using {0}'.format(filename))
    with open(filename) as f:
        transport = Serial(port='/dev/ttyACM0', baudrate=115200, timeout=5)
        print(transport)
        protocol = MSP(transport, initialization_delay=15)
        for i in range(0, MAX_WAYPOINTS):
            wp_no = i + 1

            line = f.readline().strip()
            if not line:
                break
            waypoint = line.split(' ')
            if waypoint[0].startswith(COMMENT_START_CHAR):
                continue

            print(waypoint)
            send_waypoint(
                protocol, {
                    'wp_no': wp_no,
                    'action': MSP_WAYPOINT_ACTIONS[waypoint[IDX_ACTION]],
Esempio n. 5
0
 def __init__(self, group_obj, assump_size, verbose=False):
     ABEnc.__init__(self)
     self.group = group_obj
     self.assump_size = assump_size  # size of linear assumption, at least 2
     self.util = MSP(self.group, verbose)
Esempio n. 6
0
 def __init__(self, groupObj, assump_size, uni_size, verbose=False):
     ABEnc.__init__(self)
     self.group = groupObj
     self.assump_size = assump_size  # size of the linear assumption
     self.uni_size = uni_size  # bound on the size of the universe of attributes
     self.util = MSP(self.group, verbose)  
Esempio n. 7
0
 def run(self):
     print '\n#### COM ####'
     ann, knn, msp, svm = ANN(), KNN(), MSP(), SVM()
     self.gotta.emit({'ann': ann, 'knn': knn, 'msp': msp, 'svm': svm})
     print '#### COM ####\n'