forked from GitHub/gf-core
add const specifier to make md5 more general
This commit is contained in:
@@ -129,7 +129,7 @@ void md5Step(uint32_t *buffer, uint32_t *input){
|
|||||||
* If the input fills out a block of 512 bits, apply the algorithm (md5Step)
|
* If the input fills out a block of 512 bits, apply the algorithm (md5Step)
|
||||||
* and save the result in the buffer. Also updates the overall size.
|
* and save the result in the buffer. Also updates the overall size.
|
||||||
*/
|
*/
|
||||||
void MD5Context::update(uint8_t *input_buffer, size_t input_len)
|
void MD5Context::update(const uint8_t *input_buffer, size_t input_len)
|
||||||
{
|
{
|
||||||
uint32_t input[16];
|
uint32_t input[16];
|
||||||
unsigned int offset = this->size % 64;
|
unsigned int offset = this->size % 64;
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ class PGF_INTERNAL_DECL MD5Context {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
MD5Context();
|
MD5Context();
|
||||||
void update(uint8_t *input, size_t input_len);
|
void update(const uint8_t *input, size_t input_len);
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void update(T &input)
|
void update(const T &input)
|
||||||
{
|
{
|
||||||
update((uint8_t *) &input, sizeof(T));
|
update((const uint8_t *) &input, sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
void finalize(MD5Digest *digest);
|
void finalize(MD5Digest *digest);
|
||||||
|
|||||||
Reference in New Issue
Block a user