php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
sha1.c File Reference
#include "php.h"
#include "sha1.h"
#include "md5.h"

Go to the source code of this file.

Macros

#define F(x, y, z)
 
#define G(x, y, z)
 
#define H(x, y, z)
 
#define I(x, y, z)
 
#define ROTATE_LEFT(x, n)
 
#define W(i)
 
#define FF(a, b, c, d, e, w)
 
#define GG(a, b, c, d, e, w)
 
#define HH(a, b, c, d, e, w)
 
#define II(a, b, c, d, e, w)
 

Functions

PHPAPI void make_sha1_digest (char *sha1str, const unsigned char *digest)
 
 PHP_FUNCTION (sha1)
 
 PHP_FUNCTION (sha1_file)
 
PHPAPI void PHP_SHA1InitArgs (PHP_SHA1_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args)
 
PHPAPI void PHP_SHA1Update (PHP_SHA1_CTX *context, const unsigned char *input, size_t inputLen)
 
PHPAPI void PHP_SHA1Final (unsigned char digest[20], PHP_SHA1_CTX *context)
 

Macro Definition Documentation

◆ F

#define F ( x,
y,
z )
Value:
((z) ^ ((x) & ((y) ^ (z))))

Definition at line 114 of file sha1.c.

◆ FF

#define FF ( a,
b,
c,
d,
e,
w )
Value:
{ \
(e) += F ((b), (c), (d)) + (w) + (uint32_t)(0x5A827999); \
(e) += ROTATE_LEFT ((a), 5); \
(b) = ROTATE_LEFT((b), 30); \
}
#define F
Definition encoding.c:235
#define ROTATE_LEFT(x, n)
Definition sha1.c:121
$obj a
Definition test.php:84

Definition at line 130 of file sha1.c.

◆ G

#define G ( x,
y,
z )
Value:
((x) ^ (y) ^ (z))

Definition at line 115 of file sha1.c.

◆ GG

#define GG ( a,
b,
c,
d,
e,
w )
Value:
{ \
(e) += G ((b), (c), (d)) + (w) + (uint32_t)(0x6ED9EBA1); \
(e) += ROTATE_LEFT ((a), 5); \
(b) = ROTATE_LEFT((b), 30); \
}
#define G(L)
Definition minilua.c:489

Definition at line 135 of file sha1.c.

◆ H

#define H ( x,
y,
z )
Value:
(((x) & (y)) | ((z) & ((x) | (y))))

Definition at line 116 of file sha1.c.

◆ HH

#define HH ( a,
b,
c,
d,
e,
w )
Value:
{ \
(e) += H ((b), (c), (d)) + (w) + (uint32_t)(0x8F1BBCDC); \
(e) += ROTATE_LEFT ((a), 5); \
(b) = ROTATE_LEFT((b), 30); \
}
#define H(x, y, z)
Definition md5.c:146

Definition at line 140 of file sha1.c.

◆ I

#define I ( x,
y,
z )
Value:
((x) ^ (y) ^ (z))

Definition at line 117 of file sha1.c.

◆ II

#define II ( a,
b,
c,
d,
e,
w )
Value:
{ \
(e) += I ((b), (c), (d)) + (w) + (uint32_t)(0xCA62C1D6); \
(e) += ROTATE_LEFT ((a), 5); \
(b) = ROTATE_LEFT((b), 30); \
}
#define I
Definition encoding.c:237

Definition at line 145 of file sha1.c.

◆ ROTATE_LEFT

#define ROTATE_LEFT ( x,
n )
Value:
(((x) << (n)) | ((x) >> (32-(n))))
zend_long n
Definition ffi.c:4979

Definition at line 121 of file sha1.c.

◆ W

#define W ( i)
Value:
( tmp=x[(i-3)&15]^x[(i-8)&15]^x[(i-14)&15]^x[i&15], \
(x[i&15]=ROTATE_LEFT(tmp, 1)) )

Definition at line 125 of file sha1.c.

Function Documentation

◆ make_sha1_digest()

PHPAPI void make_sha1_digest ( char * sha1str,
const unsigned char * digest )

Definition at line 24 of file sha1.c.

◆ PHP_FUNCTION() [1/2]

PHP_FUNCTION ( sha1 )

Definition at line 30 of file sha1.c.

◆ PHP_FUNCTION() [2/2]

PHP_FUNCTION ( sha1_file )

Definition at line 59 of file sha1.c.

◆ PHP_SHA1Final()

PHPAPI void PHP_SHA1Final ( unsigned char digest[20],
PHP_SHA1_CTX * context )

Definition at line 215 of file sha1.c.

◆ PHP_SHA1InitArgs()

PHPAPI void PHP_SHA1InitArgs ( PHP_SHA1_CTX * context,
ZEND_ATTRIBUTE_UNUSED HashTable * args )

Definition at line 155 of file sha1.c.

◆ PHP_SHA1Update()

PHPAPI void PHP_SHA1Update ( PHP_SHA1_CTX * context,
const unsigned char * input,
size_t inputLen )

Definition at line 173 of file sha1.c.