summaryrefslogtreecommitdiff
path: root/includes/BSHA1.h
blob: f70f6b79f5398e5d88175e05f267dc87b55a2581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include <Exceptions.h>

namespace Balau {

class SHA1 {
  public:
      SHA1() { reset(); }
    void reset();
    void update(const uint8_t* data, const size_t len);
    void final(uint8_t * digest);

    enum { DIGEST_SIZE = 20 };

  private:
    void transform(uint32_t state[5], const uint8_t buffer[64]);

    uint32_t m_state[5];
    uint32_t m_count[2];
    uint8_t m_buffer[64];
};

};