summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2021-02-11 22:55:18 -0500
committerrsiddharth <s@ricketyspace.net>2021-02-11 22:55:18 -0500
commit23f4db9729dbc756bd53976e6c2a742259514625 (patch)
treeffc7b7851a2738b58b060d25e4efb3b00554c0bc
parent9caebaeddfba08daceee012fb1034ef97d54d380 (diff)
lib: randomInt -> RandomInt
-rw-r--r--lib/oracle.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/oracle.go b/lib/oracle.go
index a8daa12..30ffe4c 100644
--- a/lib/oracle.go
+++ b/lib/oracle.go
@@ -14,7 +14,7 @@ dXN0IHRvIHNheSBoaQpEaWQgeW91IHN0b3A/IE5vLCBJIGp1c3QgZHJvdmUg
YnkK`
var oracleKey []byte = make([]byte, 16)
-var oracleRandom []byte = make([]byte, randomInt(1, 4096))
+var oracleRandom []byte = make([]byte, RandomInt(1, 4096))
func init() {
_, err := rand.Read(oracleKey)
@@ -76,9 +76,9 @@ func OracleAESVarEncryptECB(in []byte) []byte {
}
// Return a random number from range [min, max]
-func randomInt(min, max int64) int64 {
+func RandomInt(min, max int64) int64 {
if min >= max {
- panic("randomInt: min cannot be >= max!")
+ panic("RandomInt: min cannot be >= max!")
}
var rn *big.Int
@@ -96,7 +96,7 @@ func randomInt(min, max int64) int64 {
// Randomly generates `min` to `max` bytes.
func randomBytes(min, max int64) []byte {
- bs := make([]byte, randomInt(min, max))
+ bs := make([]byte, RandomInt(min, max))
_, err := rand.Read(bs)
if err != nil {
panic(err)