SHA1 support

File: csp/crypto/csp_sha1.h

Description: SHA1 support. Code originally from Python’s SHA1 Module, who based it on libtom.org.

Defines

CSP_SHA1_BLOCKSIZE
[source]

The SHA1 block size in bytes

CSP_SHA1_DIGESTSIZE
[source]

The SHA1 digest (hash) size in bytes

Typedefs

type csp_sha1_state_t
[source]

SHA1 state.

uint8_t buf[64]
[source]

Internal SHA1 state.

uint32_t curlen
[source]

Internal SHA1 state.

uint64_t length
[source]

Internal SHA1 state.

uint32_t state[5]
[source]

Internal SHA1 state.

Interface Functions

void csp_sha1_init(csp_sha1_state_t *state)
[source]

Initialize the hash state

Parameters:
  • state – hash state.

void csp_sha1_process(csp_sha1_state_t *state, const void *data, uint32_t length)
[source]

Process a block of memory through the hash.

Parameters:
  • state – hash state

  • data – data.

  • length – length of data.

void csp_sha1_done(csp_sha1_state_t *state, uint8_t *sha1)
[source]

Terminate the hash calculation and get the SHA1.

Parameters:
  • state – hash state

  • sha1 – user supplied buffer of minimum #CSP_SHA1_DIGESTSIZE bytes.

void csp_sha1_memory(const void *data, uint32_t length, uint8_t *sha1)
[source]

Calculate SHA1 hash of block of memory.

Parameters:
  • data – data.

  • length – length of data.

  • sha1 – user supplied buffer of minimum #CSP_SHA1_DIGESTSIZE bytes.