|
YAZ 5.35.1
|
Implements SHA1 creation over WRBUF. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <yaz/wrbuf.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | SHA1_CTX |
Macros | |
| #define | SHA1HANDSOFF |
| #define | rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) |
| #define | blk0(i) |
| #define | blk(i) |
| #define | R0(v, w, x, y, z, i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); |
| #define | R1(v, w, x, y, z, i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); |
| #define | R2(v, w, x, y, z, i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); |
| #define | R3(v, w, x, y, z, i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); |
| #define | R4(v, w, x, y, z, i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); |
Functions | |
| static void | SHA1Transform (uint32_t state[5], const unsigned char buffer[64]) |
| static void | SHA1Init (SHA1_CTX *context) |
| static void | SHA1Update (SHA1_CTX *context, const unsigned char *data, uint32_t len) |
| static void | SHA1Final (unsigned char digest[20], SHA1_CTX *context) |
| int | wrbuf_sha1_write (WRBUF b, const char *cp, size_t sz, int hexit) |
| writes SHA1 text to WRBUF | |
| int | wrbuf_sha1_puts (WRBUF b, const char *cp, int hexit) |
| writes SHA1 text to WRBUF | |
Implements SHA1 creation over WRBUF.
Definition in file wrbuf_sha1.c.
| #define blk | ( | i | ) |
Definition at line 54 of file wrbuf_sha1.c.
| #define blk0 | ( | i | ) |
Definition at line 51 of file wrbuf_sha1.c.
Definition at line 58 of file wrbuf_sha1.c.
Definition at line 59 of file wrbuf_sha1.c.
Definition at line 60 of file wrbuf_sha1.c.
Definition at line 61 of file wrbuf_sha1.c.
Definition at line 62 of file wrbuf_sha1.c.
| #define rol | ( | value, | |
| bits | |||
| ) | (((value) << (bits)) | ((value) >> (32 - (bits)))) |
Definition at line 44 of file wrbuf_sha1.c.
| #define SHA1HANDSOFF |
Definition at line 29 of file wrbuf_sha1.c.
|
static |
Definition at line 167 of file wrbuf_sha1.c.
References SHA1_CTX::count, SHA1Update(), and SHA1_CTX::state.
Referenced by wrbuf_sha1_write().
|
static |
Definition at line 128 of file wrbuf_sha1.c.
References SHA1_CTX::count, and SHA1_CTX::state.
Referenced by wrbuf_sha1_write().
|
static |
Definition at line 67 of file wrbuf_sha1.c.
References R0, R1, R2, R3, and R4.
Referenced by SHA1Update().
|
static |
Definition at line 142 of file wrbuf_sha1.c.
References SHA1_CTX::buffer, SHA1_CTX::count, SHA1Transform(), and SHA1_CTX::state.
Referenced by SHA1Final(), and wrbuf_sha1_write().
| int wrbuf_sha1_puts | ( | WRBUF | b, |
| const char * | cp, | ||
| int | hexit | ||
| ) |
writes SHA1 text to WRBUF
| b | result |
| cp | C-string |
| hexit | 1=hex mode; 0=binary |
Definition at line 214 of file wrbuf_sha1.c.
References wrbuf_sha1_write().
Referenced by wrbuf_vary_puts(), and ZOOM_memcached_resultset().
| int wrbuf_sha1_write | ( | WRBUF | b, |
| const char * | cp, | ||
| size_t | sz, | ||
| int | hexit | ||
| ) |
writes SHA1 text to WRBUF
| b | result |
| cp | char buffer |
| sz | size of char buffer |
| hexit | 1=hex mode; 0=binary |
Definition at line 194 of file wrbuf_sha1.c.
References SHA1Final(), SHA1Init(), SHA1Update(), wrbuf_printf(), and wrbuf_write().
Referenced by wrbuf_sha1_puts(), and ZOOM_memcached_add().