<commit_before>{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE StandaloneDeriving #-}

{- | Convenient wrappers over public key crypto (RSA at the moment).

TODO:

1. We use SHA256 in this module. According to
   <http://security.stackexchange.com/a/112032>, we could've used SHA1 and
   save a bit on message size. I'm not a crypto expert so I'm leaving SHA256.

2. We use blinders everywhere. Again, no idea whether they're needed in our
   case or not.

3. We use 2048-bit keys. Is it too much? Too little? Do we need “security
   past 2030” (i.e. what Wikipedia says about longer keys)?

4. Do we want to store type info in 'Binary' instance of 'Encrypted' (so that
   type mismatch when decoding 'Encrypted' would be caught)?
-}
module Pos.Crypto.Pki
       (
       -- * Keys
         PublicKey
       , SecretKey
       , keyGen
       , toPublic
       , formatFullPublicKey
       , fullPublicKeyF
       , parseFullPublicKey

       -- * Encryption and decryption
       , Encrypted
       , DecryptionError (..)
       , encrypt
       , decrypt

       -- * Signing and verification
       , Signature
       , sign
       , verify

       -- * Versions for raw bytestrings
       , encryptRaw
       , decryptRaw
       , signRaw<commit_msg>Remove resolved TODOs<commit_after>{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE StandaloneDeriving #-}

{- | Convenient wrappers over public key crypto (RSA at the moment).

TODO: Do we want to store type info in 'Binary' instance of 'Encrypted' (so
that type mismatch when decoding 'Encrypted' would be caught)?
-}
module Pos.Crypto.Pki
       (
       -- * Keys
         PublicKey
       , SecretKey
       , keyGen
       , toPublic
       , formatFullPublicKey
       , fullPublicKeyF
       , parseFullPublicKey

       -- * Encryption and decryption
       , Encrypted
       , DecryptionError (..)
       , encrypt
       , decrypt

       -- * Signing and verification
       , Signature
       , sign
       , verify

       -- * Versions for raw bytestrings
       , encryptRaw
       , decryptRaw
       , signRaw
{'fraction_non_alphanumeric': 0.08209313490158425, 'fraction_numerical': 0.01200192030724916, 'mean_word_length': 2.0647058823529414, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6776183', 'n_tokens_mistral': 641, 'n_tokens_neox': 602, 'n_words': 208}