Browse Source

Add const in codec.cpp

pull/910/head
Anders Jenbo 6 years ago
parent
commit
12f4fa44b8
  1. 6
      Source/codec.cpp
  2. 4
      Source/codec.h

6
Source/codec.cpp

@ -14,7 +14,7 @@ typedef struct CodecSignature {
#define BLOCKSIZE 64 #define BLOCKSIZE 64
static void codec_init_key(int unused, char *pszPassword) static void codec_init_key(int unused, const char *pszPassword)
{ {
int i, ch, n; int i, ch, n;
char key[136]; // last 64 bytes are the SHA1 char key[136]; // last 64 bytes are the SHA1
@ -50,7 +50,7 @@ static void codec_init_key(int unused, char *pszPassword)
memset(key, 0, sizeof(key)); memset(key, 0, sizeof(key));
} }
int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword) int codec_decode(BYTE *pbSrcDst, DWORD size, const char *pszPassword)
{ {
char buf[128]; char buf[128];
char dst[SHA1HashSize]; char dst[SHA1HashSize];
@ -101,7 +101,7 @@ DWORD codec_get_encoded_len(DWORD dwSrcBytes)
return dwSrcBytes + sizeof(CodecSignature); return dwSrcBytes + sizeof(CodecSignature);
} }
void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, char *pszPassword) void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, const char *pszPassword)
{ {
char buf[128]; char buf[128];
char tmp[SHA1HashSize]; char tmp[SHA1HashSize];

4
Source/codec.h

@ -6,8 +6,8 @@
#ifndef __CODEC_H__ #ifndef __CODEC_H__
#define __CODEC_H__ #define __CODEC_H__
int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword); int codec_decode(BYTE *pbSrcDst, DWORD size, const char *pszPassword);
DWORD codec_get_encoded_len(DWORD dwSrcBytes); DWORD codec_get_encoded_len(DWORD dwSrcBytes);
void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, char *pszPassword); void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, const char *pszPassword);
#endif /* __CODEC_H__ */ #endif /* __CODEC_H__ */

Loading…
Cancel
Save