summaryrefslogtreecommitdiffabout
path: root/lib/secret.cc
Unidiff
Diffstat (limited to 'lib/secret.cc') (more/less context) (show whitespace changes)
-rw-r--r--lib/secret.cc22
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/secret.cc b/lib/secret.cc
index ae8a3c5..632a2ca 100644
--- a/lib/secret.cc
+++ b/lib/secret.cc
@@ -4,3 +4,3 @@
4#include <opkele/exception.h> 4#include <opkele/exception.h>
5#include <mimetic/mimetic.h> 5#include <opkele/util.h>
6 6
@@ -25,6 +25,3 @@ namespace opkele {
25 bitwise_xor<unsigned char,unsigned char,unsigned char>() ); 25 bitwise_xor<unsigned char,unsigned char,unsigned char>() );
26 mimetic::Base64::Encoder b(0); 26 rv = util::encode_base64(&(tmp.front()),tmp.size());
27 mimetic::encode(
28 tmp.begin(),tmp.end(), b,
29 back_insert_iterator<string>(rv) );
30 } 27 }
@@ -32,7 +29,4 @@ namespace opkele {
32 void secret_t::enxor_from_base64(const unsigned char *key_sha1,const string& b64) { 29 void secret_t::enxor_from_base64(const unsigned char *key_sha1,const string& b64) {
33 mimetic::Base64::Decoder b;
34 clear(); 30 clear();
35 mimetic::decode( 31 util::decode_base64(b64,*this);
36 b64.begin(),b64.end(), b,
37 back_insert_iterator<secret_t>(*this) );
38 transform( 32 transform(
@@ -47,6 +41,3 @@ namespace opkele {
47 throw bad_input(OPKELE_CP_ "wrong secret size"); 41 throw bad_input(OPKELE_CP_ "wrong secret size");
48 mimetic::Base64::Encoder b(0); 42 rv = util::encode_base64(&(front()),size());
49 mimetic::encode(
50 begin(),end(), b,
51 back_insert_iterator<string>(rv) );
52 } 43 }
@@ -54,6 +45,3 @@ namespace opkele {
54 void secret_t::from_base64(const string& b64) { 45 void secret_t::from_base64(const string& b64) {
55 mimetic::Base64::Decoder b; 46 util::decode_base64(b64,*this);
56 mimetic::decode(
57 b64.begin(),b64.end(), b,
58 back_insert_iterator<secret_t>(*this) );
59 } 47 }