summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/oracle.go8
-rw-r--r--lib/rand.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/oracle.go b/lib/oracle.go
index e2ee5fe..4def7e2 100644
--- a/lib/oracle.go
+++ b/lib/oracle.go
@@ -14,12 +14,12 @@ var oracleRandom []byte
func init() {
var err error
- oracleKey, err = RandomKey(16)
+ oracleKey, err = RandomBytes(16)
if err != nil {
panic(err)
}
- oracleRandom, err = RandomKey(int(RandomInt(1, 4096)))
+ oracleRandom, err = RandomBytes(int(RandomInt(1, 4096)))
if err != nil {
panic(err)
}
@@ -30,12 +30,12 @@ func init() {
// cipher.
func OracleAESRandomEncrypt(in []byte) []byte {
// Generate random key.
- key, err := RandomKey(16)
+ key, err := RandomBytes(16)
if err != nil {
panic(err)
}
// Generate random initialization vector; needed for AES CBC.
- iv, err := RandomKey(16)
+ iv, err := RandomBytes(16)
if err != nil {
panic(err)
}
diff --git a/lib/rand.go b/lib/rand.go
index 03fd651..8546948 100644
--- a/lib/rand.go
+++ b/lib/rand.go
@@ -27,7 +27,7 @@ func RandomInt(min, max int64) int64 {
}
}
-func RandomKey(size int) ([]byte, error) {
+func RandomBytes(size int) ([]byte, error) {
k := make([]byte, size)
_, err := rand.Read(k)
if err != nil {