blindscrambler 0.1.1__cp39-abi3-macosx_11_0_arm64.whl → 0.1.3__cp39-abi3-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blindscrambler/_core.abi3.so +0 -0
- blindscrambler/distributions/__init__.py +2 -0
- blindscrambler/distributions/cvdistributions.py +47 -0
- {blindscrambler-0.1.1.dist-info → blindscrambler-0.1.3.dist-info}/METADATA +1 -1
- {blindscrambler-0.1.1.dist-info → blindscrambler-0.1.3.dist-info}/RECORD +6 -4
- {blindscrambler-0.1.1.dist-info → blindscrambler-0.1.3.dist-info}/WHEEL +0 -0
blindscrambler/_core.abi3.so
CHANGED
Binary file
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# Metadata:
|
2
|
+
# Author: Syed Raza
|
3
|
+
# email: sar0033@uah.edu
|
4
|
+
|
5
|
+
# use python secrets to make a normally distributed random samples
|
6
|
+
import secrets
|
7
|
+
import numpy as np
|
8
|
+
|
9
|
+
def uniform(a: float = 0.0, b: float = 1.0) -> float:
|
10
|
+
"""
|
11
|
+
Cryptographically secure sample
|
12
|
+
"""
|
13
|
+
# 53 random bits gives 53-bit precision double
|
14
|
+
u = secrets.randbits(53) / (1 << 53) # in [0, 1)
|
15
|
+
|
16
|
+
return a + (b - a) * u
|
17
|
+
|
18
|
+
def exponentialdist(lam):
|
19
|
+
"""
|
20
|
+
Params:
|
21
|
+
(1) lam : double
|
22
|
+
The number lambda that will be used to generate samples of the exponential distributions
|
23
|
+
|
24
|
+
Returns:
|
25
|
+
(2) ran : double
|
26
|
+
A random sample that is exponentially distributed
|
27
|
+
|
28
|
+
Function description: Basically, this function performs Inverse Transform Sampling. You take a random number generated between [0, 1]
|
29
|
+
This represets the CDF of some given distribution. Then you apply the inverse CDF function to generate a sample. The given sample will
|
30
|
+
be from the distribution in question.
|
31
|
+
|
32
|
+
NOTE: the inverse CDF used here is from the exponential distribution. Therefore, the generated numbers will be exponentially distributed
|
33
|
+
"""
|
34
|
+
|
35
|
+
# use the unifrom function above to generate a uniformly distributed sample in the range --> [0, 1]
|
36
|
+
y = uniform()
|
37
|
+
|
38
|
+
# use this y to generate the exponential sample
|
39
|
+
x = -(1/lam) * np.ln(y)
|
40
|
+
|
41
|
+
# return this sample :)
|
42
|
+
return x
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
if __name__ == "__main__":
|
47
|
+
print("This is main!")
|
@@ -1,11 +1,13 @@
|
|
1
|
-
blindscrambler-0.1.
|
2
|
-
blindscrambler-0.1.
|
1
|
+
blindscrambler-0.1.3.dist-info/METADATA,sha256=jscQZmON4cPMgoLxXnce2AZLrRUfsTiq1d3v6Nqy5A0,373
|
2
|
+
blindscrambler-0.1.3.dist-info/WHEEL,sha256=DLqF2HZq4W_umZdP6RnfAuqhmtX_UrV4mkqrSIMhipE,102
|
3
3
|
blindscrambler/__init__.py,sha256=N6o-PTyGSlQ4ny1UA4ByeNenVF-wCTALnyP4WJ8PGas,98
|
4
|
-
blindscrambler/_core.abi3.so,sha256=
|
4
|
+
blindscrambler/_core.abi3.so,sha256=4uKUtCwAO1Hbvzv0FXAt38rEHYbg-Quio8CdkJ_UMrk,440112
|
5
5
|
blindscrambler/_core.pyi,sha256=b6oJaUXUzEzqUE5rpqefV06hl8o_JCU8pgKgIIzQgmc,33
|
6
6
|
blindscrambler/differential/__init__.py,sha256=INnk5rX2ae6mG5yynAQYKzpQ0BYsHquUhA9ZzbPVLm8,45
|
7
7
|
blindscrambler/differential/discrete.py,sha256=mPJg6YrDVuXK-dLXgb_VDqKl1IvKfSKahMA_rRTVKQY,369
|
8
|
+
blindscrambler/distributions/__init__.py,sha256=8O4VQvymecRFRP1njwAfbD4yUACA25RcLqn0QtZEjaE,58
|
9
|
+
blindscrambler/distributions/cvdistributions.py,sha256=fU85sPxNJdnzVr_csR9foFzXr_ARGFlfdvFoJqPI7pA,1434
|
8
10
|
blindscrambler/matrix/__init__.py,sha256=qlItVU8AVj_mP2NUJ3gor-lsovxk3Wxf5tUfKynoUbg,157
|
9
11
|
blindscrambler/matrix/elementary.py,sha256=hArZLiBTA_vW1EZ0RniECf6ybJiJxO7KNuVHb_TZFQU,3987
|
10
12
|
blindscrambler/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
blindscrambler-0.1.
|
13
|
+
blindscrambler-0.1.3.dist-info/RECORD,,
|
File without changes
|