   Returns
         (Key) An instance of the Key class wrapping the raw key bytes"
   [#^bytes k-byte-array {:keys [algorithm curve ephemeral type]}]
+  ;; FIXME: What is the type of input k-byte-array? Base64 encoded string or decoded bytes?
+  ;;    (current implementation assumes decoded bytes)
   (let [curve-name (name curve)
         parameter-spec (ECNamedCurveTable/getParameterSpec curve-name)
         curve (.getCurve parameter-spec)
         curve-size (/ (* 2 (.getFieldSize curve)) 8) ;; x + y
-        key-size (count k-byte-array)
-        middle (int (/ key-size 2))]
+        key-size (count k-byte-array)]
     (if (= curve-size key-size)
-      (let [kf (KeyFactory/getInstance (name algorithm) BouncyCastleProvider/PROVIDER_NAME)
+      (let [middle (int (/ key-size 2))
+            kf (KeyFactory/getInstance (name algorithm) BouncyCastleProvider/PROVIDER_NAME)
             spec (ECPublicKeySpec. (ECPoint. (java.math.BigInteger. 1 (Arrays/copyOfRange k-byte-array (int 0) middle))
                                              (java.math.BigInteger. 1 (Arrays/copyOfRange k-byte-array middle key-size)))
                                    (ECNamedCurveSpec. curve-name curve (.getG parameter-spec) (.getN parameter-spec)

  Returns
        (Key) An instance of the Key class corresponding to the ski"
  [ski]
  
  )

;;;hash

"f5B7ECxK0kdmXPXIEBiizYACIQD2x39Q4oVwO5uL6m3AVNI98C2LZWa0g2iea8wk"
"BAHpeA=="
"-----END CERTIFICATE-----"))

  (= (hash test-msg {:algorithm :sha256}) hash-msg-sha256)
  (= (hash test-long-msg {:algorithm :sha256}) hash-long-msg-sha256)
  (= (hash test-msg {:algorithm :sha384}) hash-msg-sha384)
  (= (hash test-long-msg {:algorithm :sha384}) hash-long-msg-sha384)

  (= (hash test-msg {:algorithm :sha3-256}) hash-msg-sha3-256)
  (= (hash test-long-msg {:algorithm :sha3-256}) hash-long-msg-sha3-256)
  (= (hash test-msg {:algorithm :sha3-384}) hash-msg-sha3-384)
  (= (hash test-long-msg {:algorithm :sha3-384}) hash-long-msg-sha3-384)
  
  )

