Skip to content

Commit

Permalink
nip44 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Aug 24, 2024
1 parent f1306f5 commit 8cc20cf
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/Nostr/Encryption.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Crypto.Cipher.ChaCha (generate, initialize)
import Crypto.Hash (SHA256(..))
import Crypto.KDF.HKDF (PRK, extract, expand)
import Crypto.MAC.HMAC (HMAC, hmac, hmacGetDigest)
import Crypto.Random (getRandomBytes)
import Data.Bits (shiftL, xor, (.|.))
import Data.ByteString (ByteString)
import Data.ByteArray (ByteArrayAccess)
Expand Down Expand Up @@ -64,9 +63,6 @@ calculateHmac key message aad =
hmacResult = hmac key combined :: HMAC SHA256
in BA.convert $ hmacGetDigest hmacResult

generateSalt :: IO ByteString
generateSalt = getRandomBytes 16

getMessageKeys :: ByteString -> ByteString -> (ByteString, ByteString, ByteString)
getMessageKeys conversationKey nonce = do
let prk = hkdfExtract conversationKey BS.empty
Expand Down

0 comments on commit 8cc20cf

Please sign in to comment.