Auto AES128 block size
This commit is contained in:
parent
3ac90b7f3d
commit
a2376184dc
1 changed files with 3 additions and 3 deletions
|
|
@ -13,9 +13,6 @@
|
|||
|
||||
;;;; Default digests, ciphers, etc.
|
||||
|
||||
(def ^:private ^:const aes128-block-size (int 16))
|
||||
(def ^:private ^:const salt-size (int 16))
|
||||
|
||||
(def ^:private ^javax.crypto.Cipher aes128-cipher
|
||||
(javax.crypto.Cipher/getInstance "AES/CBC/PKCS5Padding"))
|
||||
(def ^:private ^java.security.MessageDigest sha512-md
|
||||
|
|
@ -23,6 +20,9 @@
|
|||
(def ^:private ^java.security.SecureRandom prng
|
||||
(java.security.SecureRandom/getInstance "SHA1PRNG"))
|
||||
|
||||
(def ^:private ^:const aes128-block-size (.getBlockSize aes128-cipher))
|
||||
(def ^:private ^:const salt-size aes128-block-size)
|
||||
|
||||
(defn- rand-bytes [size] (let [seed (byte-array size)] (.nextBytes prng seed) seed))
|
||||
|
||||
;;;; Default keygen
|
||||
|
|
|
|||
Loading…
Reference in a new issue