php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
crypt_sha512.c File Reference
#include "php.h"
#include "php_main.h"
#include <errno.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/param.h>
#include <sys/types.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  sha512_ctx
 

Macros

#define __alignof__(type)
 
#define MIN(a, b)
 
#define MAX(a, b)
 
#define UINT64_C(value)
 
#define SWAP(n)
 
#define Ch(x, y, z)
 
#define Maj(x, y, z)
 
#define S0(x)
 
#define S1(x)
 
#define R0(x)
 
#define R1(x)
 
#define CYCLIC(w, s)
 
#define UNALIGNED_P(p)
 
#define SALT_LEN_MAX   16
 
#define ROUNDS_DEFAULT   5000
 
#define ROUNDS_MIN   1000
 
#define ROUNDS_MAX   999999999
 
#define b64_from_24bit(B2, B1, B0, N)
 

Functions

char * __php_stpncpy (char *dst, const char *src, size_t len)
 
char * php_sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen)
 
char * php_sha512_crypt (const char *key, const char *salt)
 

Macro Definition Documentation

◆ __alignof__

#define __alignof__ ( type)
Value:
offsetof (struct { char c; type member;}, member)
zend_ffi_type * type
Definition ffi.c:3812
#define offsetof(STRUCTURE, FIELD)

Definition at line 15 of file crypt_sha512.c.

◆ b64_from_24bit

#define b64_from_24bit ( B2,
B1,
B0,
N )
Value:
do { \
unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0); \
int n = (N); \
while (n-- > 0 && buflen > 0) \
{ \
*cp++ = b64t[w & 0x3f]; \
--buflen; \
w >>= 6; \
} \
} while (0)
#define N
zend_long n
Definition ffi.c:4979

◆ Ch

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

◆ CYCLIC

#define CYCLIC ( w,
s )
Value:
((w >> s) | (w << (64 - s)))
char s[4]
Definition cdf.c:77

◆ Maj

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

◆ MAX

#define MAX ( a,
b )
Value:
(((a) > (b)) ? (a) : (b))
$obj a
Definition test.php:84

Definition at line 36 of file crypt_sha512.c.

◆ MIN

#define MIN ( a,
b )
Value:
(((a) < (b)) ? (a) : (b))

Definition at line 33 of file crypt_sha512.c.

◆ R0

#define R0 ( x)
Value:
(CYCLIC (x, 1) ^ CYCLIC (x, 8) ^ (x >> 7))
#define CYCLIC(w, s)

◆ R1

#define R1 ( x)
Value:
(CYCLIC (x, 19) ^ CYCLIC (x, 61) ^ (x >> 6))

◆ ROUNDS_DEFAULT

#define ROUNDS_DEFAULT   5000

Definition at line 346 of file crypt_sha512.c.

◆ ROUNDS_MAX

#define ROUNDS_MAX   999999999

Definition at line 350 of file crypt_sha512.c.

◆ ROUNDS_MIN

#define ROUNDS_MIN   1000

Definition at line 348 of file crypt_sha512.c.

◆ S0

#define S0 ( x)
Value:
(CYCLIC (x, 28) ^ CYCLIC (x, 34) ^ CYCLIC (x, 39))

◆ S1

#define S1 ( x)
Value:
(CYCLIC (x, 14) ^ CYCLIC (x, 18) ^ CYCLIC (x, 41))

◆ SALT_LEN_MAX

#define SALT_LEN_MAX   16

Definition at line 344 of file crypt_sha512.c.

◆ SWAP

#define SWAP ( n)
Value:
(((n) << 56) \
| (((n) & 0xff00) << 40) \
| (((n) & 0xff0000) << 24) \
| (((n) & 0xff000000) << 8) \
| (((n) >> 8) & 0xff000000) \
| (((n) >> 24) & 0xff0000) \
| (((n) >> 40) & 0xff00) \
| ((n) >> 56))

Definition at line 56 of file crypt_sha512.c.

◆ UINT64_C

#define UINT64_C ( value)
Value:
__CONCAT(value, ULL)
value

Definition at line 41 of file crypt_sha512.c.

◆ UNALIGNED_P

#define UNALIGNED_P ( p)
Value:
(((uintptr_t) p) % sizeof(uint64_t) != 0)
p
Definition session.c:1105

Function Documentation

◆ __php_stpncpy()

char * __php_stpncpy ( char * dst,
const char * src,
size_t len )
extern

Definition at line 31 of file crypt_sha256.c.

◆ php_sha512_crypt()

char * php_sha512_crypt ( const char * key,
const char * salt )

Definition at line 644 of file crypt_sha512.c.

◆ php_sha512_crypt_r()

char * php_sha512_crypt_r ( const char * key,
const char * salt,
char * buffer,
int buflen )

Definition at line 358 of file crypt_sha512.c.