MadhavJivrajani/LFSR-Encryption

Optimise generation of vecs

MadhavJivrajani opened this issue · 0 comments

for k in range(self.get_max_period()):
    temp = self.__generate_next(self.companion, k)
    new_state = np.mod(np.dot(temp, self.seed), 2)

instead of computing power k, multiply already computed k-1 with companion