{-# LANGUAGE TypeApplications #-} module Test.Crypto.Vector.StringConstants ( invalidEcdsaSigLengthError, invalidSchnorrVerKeyLengthError, invalidEcdsaVerKeyLengthError, invalidSchnorrSigLengthError, cannotDecodeVerificationKeyError, unexpectedDecodingError, ) where import Cardano.Crypto.SECP256K1.Constants ( SECP256K1_ECDSA_PUBKEY_BYTES, SECP256K1_ECDSA_SIGNATURE_BYTES, SECP256K1_SCHNORR_PUBKEY_BYTES, SECP256K1_SCHNORR_SIGNATURE_BYTES, ) import Data.Data (Proxy (Proxy)) import GHC.TypeLits (natVal) invalidEcdsaVerKeyLengthError :: Integer -> String invalidEcdsaVerKeyLengthError :: Integer -> String invalidEcdsaVerKeyLengthError = Integer -> Integer -> String invalidVerKeyLengthError (Integer -> Integer -> String) -> Integer -> Integer -> String forall a b. (a -> b) -> a -> b $ Proxy SECP256K1_ECDSA_PUBKEY_BYTES -> Integer forall (n :: Natural) (proxy :: Natural -> *). KnownNat n => proxy n -> Integer natVal (Proxy SECP256K1_ECDSA_PUBKEY_BYTES -> Integer) -> Proxy SECP256K1_ECDSA_PUBKEY_BYTES -> Integer forall a b. (a -> b) -> a -> b $ forall (t :: Natural). Proxy t forall {k} (t :: k). Proxy t Proxy @SECP256K1_ECDSA_PUBKEY_BYTES invalidSchnorrVerKeyLengthError :: Integer -> String invalidSchnorrVerKeyLengthError :: Integer -> String invalidSchnorrVerKeyLengthError = Integer -> Integer -> String invalidVerKeyLengthError (Integer -> Integer -> String) -> Integer -> Integer -> String forall a b. (a -> b) -> a -> b $ Proxy SECP256K1_SCHNORR_PUBKEY_BYTES -> Integer forall (n :: Natural) (proxy :: Natural -> *). KnownNat n => proxy n -> Integer natVal (Proxy SECP256K1_SCHNORR_PUBKEY_BYTES -> Integer) -> Proxy SECP256K1_SCHNORR_PUBKEY_BYTES -> Integer forall a b. (a -> b) -> a -> b $ forall (t :: Natural). Proxy t forall {k} (t :: k). Proxy t Proxy @SECP256K1_SCHNORR_PUBKEY_BYTES invalidVerKeyLengthError :: Integer -> Integer -> String invalidVerKeyLengthError :: Integer -> Integer -> String invalidVerKeyLengthError Integer expectedLength Integer actualLength = String "decodeVerKeyDSIGN: wrong length, expected " String -> String -> String forall a. [a] -> [a] -> [a] ++ Integer -> String forall a. Show a => a -> String show Integer expectedLength String -> String -> String forall a. [a] -> [a] -> [a] ++ String " bytes but got " String -> String -> String forall a. [a] -> [a] -> [a] ++ Integer -> String forall a. Show a => a -> String show Integer actualLength invalidEcdsaSigLengthError :: Integer -> String invalidEcdsaSigLengthError :: Integer -> String invalidEcdsaSigLengthError = Integer -> Integer -> String invalidSigLengthError (Integer -> Integer -> String) -> Integer -> Integer -> String forall a b. (a -> b) -> a -> b $ Proxy SECP256K1_SCHNORR_SIGNATURE_BYTES -> Integer forall (n :: Natural) (proxy :: Natural -> *). KnownNat n => proxy n -> Integer natVal (Proxy SECP256K1_SCHNORR_SIGNATURE_BYTES -> Integer) -> Proxy SECP256K1_SCHNORR_SIGNATURE_BYTES -> Integer forall a b. (a -> b) -> a -> b $ forall (t :: Natural). Proxy t forall {k} (t :: k). Proxy t Proxy @SECP256K1_ECDSA_SIGNATURE_BYTES invalidSchnorrSigLengthError :: Integer -> String invalidSchnorrSigLengthError :: Integer -> String invalidSchnorrSigLengthError = Integer -> Integer -> String invalidSigLengthError (Integer -> Integer -> String) -> Integer -> Integer -> String forall a b. (a -> b) -> a -> b $ Proxy SECP256K1_SCHNORR_SIGNATURE_BYTES -> Integer forall (n :: Natural) (proxy :: Natural -> *). KnownNat n => proxy n -> Integer natVal (Proxy SECP256K1_SCHNORR_SIGNATURE_BYTES -> Integer) -> Proxy SECP256K1_SCHNORR_SIGNATURE_BYTES -> Integer forall a b. (a -> b) -> a -> b $ forall (t :: Natural). Proxy t forall {k} (t :: k). Proxy t Proxy @SECP256K1_SCHNORR_SIGNATURE_BYTES invalidSigLengthError :: Integer -> Integer -> String invalidSigLengthError :: Integer -> Integer -> String invalidSigLengthError Integer expectedLength Integer actualLength = String "decodeSigDSIGN: wrong length, expected " String -> String -> String forall a. [a] -> [a] -> [a] ++ Integer -> String forall a. Show a => a -> String show Integer expectedLength String -> String -> String forall a. [a] -> [a] -> [a] ++ String " bytes but got " String -> String -> String forall a. [a] -> [a] -> [a] ++ Integer -> String forall a. Show a => a -> String show Integer actualLength cannotDecodeVerificationKeyError :: String cannotDecodeVerificationKeyError :: String cannotDecodeVerificationKeyError = String "decodeVerKeyDSIGN: cannot decode key" unexpectedDecodingError :: String unexpectedDecodingError :: String unexpectedDecodingError = String "Test failed. Unexpected decoding error encountered."