php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
crypt_sha256.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  sha256_ctx
 

Macros

#define __alignof__(type)
 
#define MIN(a, b)
 
#define MAX(a, b)
 
#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_sha256_crypt_r (const char *key, const char *salt, char *buffer, int buflen)
 
char * php_sha256_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 16 of file crypt_sha256.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 << (32 - 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 44 of file crypt_sha256.c.

◆ MIN

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

Definition at line 41 of file crypt_sha256.c.

◆ R0

#define R0 ( x)
Value:
(CYCLIC (x, 7) ^ CYCLIC (x, 18) ^ (x >> 3))
#define CYCLIC(w, s)

◆ R1

#define R1 ( x)
Value:
(CYCLIC (x, 17) ^ CYCLIC (x, 19) ^ (x >> 10))

◆ ROUNDS_DEFAULT

#define ROUNDS_DEFAULT   5000

Definition at line 309 of file crypt_sha256.c.

◆ ROUNDS_MAX

#define ROUNDS_MAX   999999999

Definition at line 313 of file crypt_sha256.c.

◆ ROUNDS_MIN

#define ROUNDS_MIN   1000

Definition at line 311 of file crypt_sha256.c.

◆ S0

#define S0 ( x)
Value:
(CYCLIC (x, 2) ^ CYCLIC (x, 13) ^ CYCLIC (x, 22))

◆ S1

#define S1 ( x)
Value:
(CYCLIC (x, 6) ^ CYCLIC (x, 11) ^ CYCLIC (x, 25))

◆ SALT_LEN_MAX

#define SALT_LEN_MAX   16

Definition at line 307 of file crypt_sha256.c.

◆ SWAP

#define SWAP ( n)
Value:
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))

Definition at line 57 of file crypt_sha256.c.

◆ UNALIGNED_P

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

Function Documentation

◆ __php_stpncpy()

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

Definition at line 31 of file crypt_sha256.c.

◆ php_sha256_crypt()

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

Definition at line 592 of file crypt_sha256.c.

◆ php_sha256_crypt_r()

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

Definition at line 319 of file crypt_sha256.c.