From 9d96d7e781710b306cf40828e35843656ddfe72e Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Wed, 24 Feb 2021 18:24:46 -0500 Subject: lib: randomBytes -> randomBytesWithLengthBetween --- lib/oracle.go | 4 ++-- lib/rand.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/oracle.go b/lib/oracle.go index 4def7e2..29338ff 100644 --- a/lib/oracle.go +++ b/lib/oracle.go @@ -41,8 +41,8 @@ func OracleAESRandomEncrypt(in []byte) []byte { } // Add 5-10 bytes at the beginning and end of `in` - in = append(randomBytes(5, 10), in...) - in = append(in, randomBytes(5, 10)...) + in = append(randomBytesWithLengthBetween(5, 10), in...) + in = append(in, randomBytesWithLengthBetween(5, 10)...) // Randomly encrypt `in` with AES in ECB or CBC mode. m := RandomInt(0, 1) diff --git a/lib/rand.go b/lib/rand.go index 8546948..1ba1679 100644 --- a/lib/rand.go +++ b/lib/rand.go @@ -37,7 +37,7 @@ func RandomBytes(size int) ([]byte, error) { } // Randomly generates `min` to `max` bytes. -func randomBytes(min, max int64) []byte { +func randomBytesWithLengthBetween(min, max int64) []byte { bs := make([]byte, RandomInt(min, max)) _, err := rand.Read(bs) if err != nil { -- cgit v1.2.3