user935: I am looking for a function with a type like this:
verifySignature :: Datum -> Signature -> PubKey -> Bool

which is also INLINABLE to use it inside validator.
I know that we can check if the whole transaction is signed by some pub key with this function, but this should be an arbitrary message signature, not transaction signature.

user935: There is also an oracle for signature verification here

user2537: I think PlutusTx.Builtins has what you need:
{-# INLINABLE verifySignature #-}
-- | Verify that the signature is a signature of the message by the public key.
verifySignature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool

You can use verifySignature on-chain. If you do it on chain, then your signature and the PubKeyHash should be either some wrappers around BuiltinByteString or directly BuiltinByteString. Either way, there should be no problem getting the types needed for verifySignature.

935: <p>I am looking for a function with a type like this:</p>
<pre><code>verifySignature :: Datum -&gt; Signature -&gt; PubKey -&gt; Bool
</code></pre>
<p>which is also INLINABLE to use it inside validator.</p>
<p>I know that we can check if the whole transaction is signed by some pub key with this <a href="https://github.com/input-output-hk/plutus/blob/b778f9abbe172177b579badf83b899ee05fda2e0/plutus-ledger-api/src/Plutus/V1/Ledger/Contexts.hs#L233" rel="nofollow noreferrer">function</a>, but this should be an arbitrary message signature, not transaction signature.</p>
 935: <p>There is also an oracle for signature verification <a href="https://github.com/input-output-hk/plutus-apps/blob/804a84bd15074902cce9096ef98721675566c003/plutus-contract/src/Plutus/Contract/Oracle.hs?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L13" rel="nofollow noreferrer">here</a></p>
 2537: <p>I think PlutusTx.Builtins has what you need:</p>
<pre><code>{-# INLINABLE verifySignature #-}
-- | Verify that the signature is a signature of the message by the public key.
verifySignature :: BuiltinByteString -&gt; BuiltinByteString -&gt; BuiltinByteString -&gt; Bool
</code></pre>
<p>You can use verifySignature on-chain. If you do it on chain, then your signature and the PubKeyHash should be either some wrappers around <code>BuiltinByteString</code> or directly <code>BuiltinByteString</code>. Either way, there should be no problem getting the types needed for <code>verifySignature</code>.</p>
