php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
crypt_blowfish.c File Reference
#include <string.h>
#include <errno.h>
#include "crypt_blowfish.h"

Go to the source code of this file.

Data Structures

struct  BF_ctx
 

Macros

#define __set_errno(val)
 
#define BF_SCALE   0
 
#define BF_N   16
 
#define BF_safe_atoi64(dst, src)
 
#define BF_INDEX(S, i)
 
#define BF_ROUND(L, R, N)
 
#define BF_ENCRYPT
 
#define BF_body()
 

Typedefs

typedef unsigned int BF_word
 
typedef signed int BF_word_signed
 
typedef BF_word BF_key[BF_N+2]
 

Functions

char * php_crypt_blowfish_rn (const char *key, const char *setting, char *output, int size)
 

Macro Definition Documentation

◆ __set_errno

#define __set_errno ( val)
Value:
zval * val
Definition ffi.c:4262
#define errno

Definition at line 50 of file crypt_blowfish.c.

◆ BF_body

#define BF_body ( )
Value:
L = R = 0; \
ptr = data.ctx.P; \
do { \
ptr += 2; \
*(ptr - 2) = L; \
*(ptr - 1) = R; \
} while (ptr < &data.ctx.P[BF_N + 2]); \
\
ptr = data.ctx.S[0]; \
do { \
ptr += 2; \
*(ptr - 2) = L; \
*(ptr - 1) = R; \
} while (ptr < &data.ctx.S[3][0xFF]);
#define BF_ENCRYPT
#define BF_N
void * ptr
Definition ffi.c:3814
#define R(tables, key, h, i, t, l, r)
Definition hash_gost.c:34
zend_constant * data

Definition at line 515 of file crypt_blowfish.c.

◆ BF_ENCRYPT

#define BF_ENCRYPT
Value:
L ^= data.ctx.P[0]; \
BF_ROUND(L, R, 0); \
BF_ROUND(R, L, 1); \
BF_ROUND(L, R, 2); \
BF_ROUND(R, L, 3); \
BF_ROUND(L, R, 4); \
BF_ROUND(R, L, 5); \
BF_ROUND(L, R, 6); \
BF_ROUND(R, L, 7); \
BF_ROUND(L, R, 8); \
BF_ROUND(R, L, 9); \
BF_ROUND(L, R, 10); \
BF_ROUND(R, L, 11); \
BF_ROUND(L, R, 12); \
BF_ROUND(R, L, 13); \
BF_ROUND(L, R, 14); \
BF_ROUND(R, L, 15); \
tmp4 = R; \
R = L; \
L = tmp4 ^ data.ctx.P[BF_N + 1];

Definition at line 493 of file crypt_blowfish.c.

◆ BF_INDEX

#define BF_INDEX ( S,
i )
Value:
(*((BF_word *)(((unsigned char *)S) + (i))))
unsigned int BF_word
#define S(s, l, r)
Definition hash_gost.c:121

Definition at line 469 of file crypt_blowfish.c.

◆ BF_N

#define BF_N   16

Definition at line 66 of file crypt_blowfish.c.

◆ BF_ROUND

#define BF_ROUND ( L,
R,
N )
Value:
tmp1 = L & 0xFF; \
tmp1 <<= 2; \
tmp2 = L >> 6; \
tmp2 &= 0x3FC; \
tmp3 = L >> 14; \
tmp3 &= 0x3FC; \
tmp4 = L >> 22; \
tmp4 &= 0x3FC; \
tmp1 = BF_INDEX(data.ctx.S[3], tmp1); \
tmp2 = BF_INDEX(data.ctx.S[2], tmp2); \
tmp3 = BF_INDEX(data.ctx.S[1], tmp3); \
tmp3 += BF_INDEX(data.ctx.S[0], tmp4); \
tmp3 ^= tmp2; \
R ^= data.ctx.P[N + 1]; \
tmp3 += tmp1; \
R ^= tmp3;
#define BF_INDEX(S, i)
#define N
#define tmp1

Definition at line 471 of file crypt_blowfish.c.

◆ BF_safe_atoi64

#define BF_safe_atoi64 ( dst,
src )
Value:
{ \
tmp = (unsigned char)(src); \
if ((unsigned int)(tmp -= 0x20) >= 0x60) return -1; \
tmp = BF_atoi64[tmp]; \
if (tmp > 63) return -1; \
(dst) = tmp; \
}
foreach($dp as $el) foreach( $dp as $el) if( $pass2< 2) echo ""

Definition at line 371 of file crypt_blowfish.c.

◆ BF_SCALE

#define BF_SCALE   0

Definition at line 59 of file crypt_blowfish.c.

Typedef Documentation

◆ BF_key

typedef BF_word BF_key[BF_N+2]

Definition at line 68 of file crypt_blowfish.c.

◆ BF_word

typedef unsigned int BF_word

Definition at line 62 of file crypt_blowfish.c.

◆ BF_word_signed

typedef signed int BF_word_signed

Definition at line 63 of file crypt_blowfish.c.

Function Documentation

◆ php_crypt_blowfish_rn()

char * php_crypt_blowfish_rn ( const char * key,
const char * setting,
char * output,
int size )

Definition at line 803 of file crypt_blowfish.c.