summaryrefslogtreecommitdiffstats
path: root/botan/src/pk_pad/emsa1_bsi/emsa1_bsi.cpp
diff options
context:
space:
mode:
authorKeith Isdale <keith.isdale@nokia.com>2010-07-26 14:56:53 +1000
committerKeith Isdale <keith.isdale@nokia.com>2010-07-26 14:56:53 +1000
commit9f034793bcfc51c2b7c1dd14db806f7258f9a9eb (patch)
tree63bd0f50ce5b77828ad8205eafd7b9412810499e /botan/src/pk_pad/emsa1_bsi/emsa1_bsi.cpp
parent619d92cfef29e653bfdf852e83888e50cfc4348f (diff)
parent65271649dbc90f3af1184ad1b23bdb64c0c07d07 (diff)
Merge branch 'master' of git://git-nokia.trolltech.com.au/qtsoftware/research/qtuitest
Diffstat (limited to 'botan/src/pk_pad/emsa1_bsi/emsa1_bsi.cpp')
-rw-r--r--botan/src/pk_pad/emsa1_bsi/emsa1_bsi.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/botan/src/pk_pad/emsa1_bsi/emsa1_bsi.cpp b/botan/src/pk_pad/emsa1_bsi/emsa1_bsi.cpp
new file mode 100644
index 0000000..212091e
--- /dev/null
+++ b/botan/src/pk_pad/emsa1_bsi/emsa1_bsi.cpp
@@ -0,0 +1,29 @@
+/*
+* EMSA1 BSI
+* (C) 1999-2008 Jack Lloyd
+* 2008 Falko Strenzke, FlexSecure GmbH
+*
+* Distributed under the terms of the Botan license
+*/
+
+#include <botan/emsa1_bsi.h>
+
+namespace Botan {
+
+/*
+* EMSA1 BSI Encode Operation
+*/
+SecureVector<byte> EMSA1_BSI::encoding_of(const MemoryRegion<byte>& msg,
+ u32bit output_bits,
+ RandomNumberGenerator&)
+ {
+ if(msg.size() != hash_ptr()->OUTPUT_LENGTH)
+ throw Encoding_Error("EMSA1_BSI::encoding_of: Invalid size for input");
+
+ if(8*msg.size() <= output_bits)
+ return msg;
+
+ throw Encoding_Error("EMSA1_BSI::encoding_of: max key input size exceeded");
+ }
+
+}