diff options
author | rsiddharth <s@ricketyspace.net> | 2021-01-12 18:50:27 -0500 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2021-01-12 18:51:32 -0500 |
commit | 66da349adc15d4de7e09093f19fcc8fc082233c6 (patch) | |
tree | 9a525da825eadb3dbfa371a20a1b16757e59d69b /lib/oracle.go | |
parent | 2caa4a6e7cd2bd6f053fd0799abf8775f6a5178a (diff) |
lib: add oracleRandom
For challenge 14. This will be used as the `random-prefix`.
Diffstat (limited to 'lib/oracle.go')
-rw-r--r-- | lib/oracle.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/oracle.go b/lib/oracle.go index 1c548ff..f117c98 100644 --- a/lib/oracle.go +++ b/lib/oracle.go @@ -14,12 +14,18 @@ dXN0IHRvIHNheSBoaQpEaWQgeW91IHN0b3A/IE5vLCBJIGp1c3QgZHJvdmUg YnkK` var oracleKey []byte = make([]byte, 16) +var oracleRandom []byte = make([]byte, randomInt(1, 16)) func init() { _, err := rand.Read(oracleKey) if err != nil { panic(err) } + + _, err = rand.Read(oracleRandom) + if err != nil { + panic(err) + } } // Given an input `in`, this function AES encrypts `in` using a |