aboutsummaryrefslogtreecommitdiffstats
path: root/src/pk_pad/emsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pk_pad/emsa.h')
-rw-r--r--src/pk_pad/emsa.h34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/pk_pad/emsa.h b/src/pk_pad/emsa.h
index 6d01beb7f..372eb836d 100644
--- a/src/pk_pad/emsa.h
+++ b/src/pk_pad/emsa.h
@@ -19,15 +19,39 @@ namespace Botan {
class BOTAN_DLL EMSA
{
public:
- virtual void update(const byte[], u32bit) = 0;
+ /**
+ * Add more data to the signature computation
+ * @param input some data
+ * @param length length of input in bytes
+ */
+ virtual void update(const byte input[], u32bit length) = 0;
+
+ /**
+ * @return raw hash
+ */
virtual SecureVector<byte> raw_data() = 0;
- virtual SecureVector<byte> encoding_of(const MemoryRegion<byte>&,
- u32bit,
+ /**
+ * Return the encoding of a message
+ * @param msg the result of raw_data()
+ * @param output_bits the desired output bit size
+ * @param rng a random number generator
+ * @return encoded signature
+ */
+ virtual SecureVector<byte> encoding_of(const MemoryRegion<byte>& msg,
+ u32bit output_bits,
RandomNumberGenerator& rng) = 0;
- virtual bool verify(const MemoryRegion<byte>&, const MemoryRegion<byte>&,
- u32bit) = 0;
+ /**
+ * Verify the encoding
+ * @param coded the received (coded) message representative
+ * @param raw the computed (local, uncoded) message representative
+ * @param key_bits the size of the key in bits
+ * @return true if coded is a valid encoding of raw, otherwise false
+ */
+ virtual bool verify(const MemoryRegion<byte>& coded,
+ const MemoryRegion<byte>& raw,
+ u32bit key_bits) = 0;
virtual ~EMSA() {}
};