lftp  4.4.7
About: lftp is a command line ftp client (FTP, HTTP, ssl support, background transfer, reget, reput, ...)
  Fossies Dox: lftp-4.4.7.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
sha1.h File Reference
#include <stdio.h>
#include <stdint.h>
Include dependency graph for sha1.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sha1_ctx
 

Macros

#define SHA1_DIGEST_SIZE   20
 

Functions

void sha1_init_ctx (struct sha1_ctx *ctx)
 
void sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
 
void sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
 
void * sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf)
 
void * sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf)
 
int sha1_stream (FILE *stream, void *resblock)
 
void * sha1_buffer (const char *buffer, size_t len, void *resblock)
 

Macro Definition Documentation

#define SHA1_DIGEST_SIZE   20

Definition at line 29 of file sha1.h.

Referenced by TorrentDispatcher::Do(), Torrent::SHA1(), and Torrent::ValidatePiece().

Function Documentation

void* sha1_buffer ( const char *  buffer,
size_t  len,
void *  resblock 
)

Definition at line 198 of file sha1.c.

References sha1_finish_ctx(), sha1_init_ctx(), and sha1_process_bytes().

Referenced by Torrent::SHA1().

void* sha1_finish_ctx ( struct sha1_ctx ctx,
void *  resbuf 
)
void sha1_init_ctx ( struct sha1_ctx ctx)

Definition at line 58 of file sha1.c.

References sha1_ctx::A, sha1_ctx::B, sha1_ctx::buflen, sha1_ctx::C, sha1_ctx::D, sha1_ctx::E, and sha1_ctx::total.

Referenced by sha1_buffer(), and sha1_stream().

void sha1_process_block ( const void *  buffer,
size_t  len,
struct sha1_ctx ctx 
)
void sha1_process_bytes ( const void *  buffer,
size_t  len,
struct sha1_ctx ctx 
)

Definition at line 213 of file sha1.c.

References add, sha1_ctx::buffer, sha1_ctx::buflen, memcpy, sha1_process_block(), and UNALIGNED_P.

Referenced by sha1_buffer(), and sha1_stream().

void* sha1_read_ctx ( const struct sha1_ctx ctx,
void *  resbuf 
)

Definition at line 82 of file sha1.c.

References sha1_ctx::A, sha1_ctx::B, sha1_ctx::C, sha1_ctx::D, sha1_ctx::E, r, and SWAP.

Referenced by sha1_finish_ctx().

int sha1_stream ( FILE *  stream,
void *  resblock 
)