Apr-22-2022, 10:15 AM
Get the TypeError: list indices must be integers or slices, not range
def getDistinctX(x_subi, F): x_subi = [] ind = random.randint(1, 5) ind = range(0, (len(F)-1)) x = F[ind] if not x in x_subi: return x else: x = getDistinctX(x_subi, F) return x
Error:Traceback (most recent call last):
File "/home/ali/Downloads/Attribute-Based-Encryption-master/LSSS_t,n.py", line 271, in <module>
runPackage([], [])
File "/home/ali/Downloads/Attribute-Based-Encryption-master/LSSS_t,n.py", line 255, in runPackage
predefinedVars, returnK = initiateScheme(predefinedVars)
File "/home/ali/Downloads/Attribute-Based-Encryption-master/LSSS_t,n.py", line 56, in initiateScheme
recovered_k = runScheme(t, n, secret_k, q, Field)
File "/home/ali/Downloads/Attribute-Based-Encryption-master/LSSS_t,n.py", line 101, in runScheme
x = getDistinctX(x_subi, Field)
File "/home/ali/Downloads/Attribute-Based-Encryption-master/LSSS_t,n.py", line 181, in getDistinctX
x = F[ind]
TypeError: list indices must be integers or slices, not range
Process finished with exit code 1