summaryrefslogtreecommitdiff
path: root/svx/inc/mscodec.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/inc/mscodec.hxx')
-rw-r--r--svx/inc/mscodec.hxx51
1 files changed, 51 insertions, 0 deletions
diff --git a/svx/inc/mscodec.hxx b/svx/inc/mscodec.hxx
index 1b72976cbf01..4ee508d661dd 100644
--- a/svx/inc/mscodec.hxx
+++ b/svx/inc/mscodec.hxx
@@ -235,6 +235,36 @@ public:
*/
bool InitCipher( sal_uInt32 nCounter );
+ /** Creates an MD5 digest of salt digest. */
+ bool CreateSaltDigest(
+ const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] );
+
+ /** Encodes a block of memory.
+
+ @see rtl_cipher_encode()
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used. The destination buffer must be able to take all
+ unencoded data from the source buffer (usually this means it must be
+ as long as or longer than the source buffer).
+
+ @param pData
+ Unencrypted source data block.
+ @param nDatLen
+ Size of the passed source data block.
+ @param pBuffer
+ Destination buffer for the encrypted data.
+ @param nBufLen
+ Size of the destination buffer.
+
+ @return
+ true = Encoding was successful (no error occured).
+ */
+ bool Encode(
+ const void* pData, sal_Size nDatLen,
+ sal_uInt8* pBuffer, sal_Size nBufLen );
+
/** Decodes a block of memory.
@see rtl_cipher_decode()
@@ -275,6 +305,27 @@ public:
*/
bool Skip( sal_Size nDatLen );
+ /** Gets salt data and salt digest.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pSalt
+ Salt, a random number.
+ @param pSaltData
+ Salt data block generated from the salt.
+ @param pSaltDigest
+ Salt digest generated from the salt.
+ */
+ void GetEncryptKey (
+ const sal_uInt8 pSalt[16],
+ sal_uInt8 pSaltData[16],
+ sal_uInt8 pSaltDigest[16]);
+
+private:
+ void GetDigestFromSalt( const sal_uInt8 pSaltData[16], sal_uInt8 pDigest[16] );
+
private:
SVX_DLLPRIVATE MSCodec_Std97( const MSCodec_Std97& );
SVX_DLLPRIVATE MSCodec_Std97& operator=( const MSCodec_Std97& );