PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/hash - hash_whirlpool.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 277 277 100.0 %
Date: 2019-05-06 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   +----------------------------------------------------------------------+
       3             :   | PHP Version 7                                                        |
       4             :   +----------------------------------------------------------------------+
       5             :   | Copyright (c) The PHP Group                                          |
       6             :   +----------------------------------------------------------------------+
       7             :   | This source file is subject to version 3.01 of the PHP license,      |
       8             :   | that is bundled with this package in the file LICENSE, and is        |
       9             :   | available through the world-wide-web at the following url:           |
      10             :   | http://www.php.net/license/3_01.txt                                  |
      11             :   | If you did not receive a copy of the PHP license and are unable to   |
      12             :   | obtain it through the world-wide-web, please send a note to          |
      13             :   | license@php.net so we can mail you a copy immediately.               |
      14             :   +----------------------------------------------------------------------+
      15             :   | Authors: Michael Wallner <mike@php.net>                              |
      16             :   |          Sara Golemon <pollita@php.net>                              |
      17             :   +----------------------------------------------------------------------+
      18             : */
      19             : 
      20             : #include "php_hash.h"
      21             : 
      22             : /*
      23             :  * TODO: simplify Update and Final, those look ridiculously complex
      24             :  * Mike, 2005-11-23
      25             :  */
      26             : 
      27             : #include "php_hash_whirlpool.h"
      28             : #include "php_hash_whirlpool_tables.h"
      29             : 
      30             : #define DIGESTBYTES 64
      31             : #define DIGESTBITS  (8*DIGESTBYTES) /* 512 */
      32             : 
      33             : #define WBLOCKBYTES 64
      34             : #define WBLOCKBITS  (8*WBLOCKBYTES) /* 512 */
      35             : 
      36             : #define LENGTHBYTES 32
      37             : #define LENGTHBITS  (8*LENGTHBYTES) /* 256 */
      38             : 
      39        1055 : static void WhirlpoolTransform(PHP_WHIRLPOOL_CTX *context)
      40             : {
      41             :     int i, r;
      42             :     uint64_t K[8];        /* the round key */
      43             :     uint64_t block[8];    /* mu(buffer) */
      44             :     uint64_t state[8];    /* the cipher state */
      45             :     uint64_t L[8];
      46        1055 :     unsigned char *buffer = context->buffer.data;
      47             : 
      48             :     /*
      49             :      * map the buffer to a block:
      50             :      */
      51        9495 :     for (i = 0; i < 8; i++, buffer += 8) {
      52        8440 :         block[i] =
      53       16880 :             (((uint64_t)buffer[0]        ) << 56) ^
      54       16880 :             (((uint64_t)buffer[1] & 0xffL) << 48) ^
      55       16880 :             (((uint64_t)buffer[2] & 0xffL) << 40) ^
      56       16880 :             (((uint64_t)buffer[3] & 0xffL) << 32) ^
      57       16880 :             (((uint64_t)buffer[4] & 0xffL) << 24) ^
      58       16880 :             (((uint64_t)buffer[5] & 0xffL) << 16) ^
      59       16880 :             (((uint64_t)buffer[6] & 0xffL) <<  8) ^
      60        8440 :             (((uint64_t)buffer[7] & 0xffL)      );
      61             :     }
      62             :     /*
      63             :      * compute and apply K^0 to the cipher state:
      64             :      */
      65        1055 :     state[0] = block[0] ^ (K[0] = context->state[0]);
      66        1055 :     state[1] = block[1] ^ (K[1] = context->state[1]);
      67        1055 :     state[2] = block[2] ^ (K[2] = context->state[2]);
      68        1055 :     state[3] = block[3] ^ (K[3] = context->state[3]);
      69        1055 :     state[4] = block[4] ^ (K[4] = context->state[4]);
      70        1055 :     state[5] = block[5] ^ (K[5] = context->state[5]);
      71        1055 :     state[6] = block[6] ^ (K[6] = context->state[6]);
      72        1055 :     state[7] = block[7] ^ (K[7] = context->state[7]);
      73             :     /*
      74             :      * iterate over all rounds:
      75             :      */
      76       11605 :     for (r = 1; r <= R; r++) {
      77             :         /*
      78             :          * compute K^r from K^{r-1}:
      79             :          */
      80       10550 :         L[0] =
      81       21100 :             C0[(int)(K[0] >> 56)       ] ^
      82       21100 :             C1[(int)(K[7] >> 48) & 0xff] ^
      83       21100 :             C2[(int)(K[6] >> 40) & 0xff] ^
      84       21100 :             C3[(int)(K[5] >> 32) & 0xff] ^
      85       21100 :             C4[(int)(K[4] >> 24) & 0xff] ^
      86       21100 :             C5[(int)(K[3] >> 16) & 0xff] ^
      87       21100 :             C6[(int)(K[2] >>  8) & 0xff] ^
      88       21100 :             C7[(int)(K[1]      ) & 0xff] ^
      89       10550 :             rc[r];
      90       10550 :         L[1] =
      91       21100 :             C0[(int)(K[1] >> 56)       ] ^
      92       21100 :             C1[(int)(K[0] >> 48) & 0xff] ^
      93       21100 :             C2[(int)(K[7] >> 40) & 0xff] ^
      94       21100 :             C3[(int)(K[6] >> 32) & 0xff] ^
      95       21100 :             C4[(int)(K[5] >> 24) & 0xff] ^
      96       21100 :             C5[(int)(K[4] >> 16) & 0xff] ^
      97       21100 :             C6[(int)(K[3] >>  8) & 0xff] ^
      98       10550 :             C7[(int)(K[2]      ) & 0xff];
      99       10550 :         L[2] =
     100       21100 :             C0[(int)(K[2] >> 56)       ] ^
     101       21100 :             C1[(int)(K[1] >> 48) & 0xff] ^
     102       21100 :             C2[(int)(K[0] >> 40) & 0xff] ^
     103       21100 :             C3[(int)(K[7] >> 32) & 0xff] ^
     104       21100 :             C4[(int)(K[6] >> 24) & 0xff] ^
     105       21100 :             C5[(int)(K[5] >> 16) & 0xff] ^
     106       21100 :             C6[(int)(K[4] >>  8) & 0xff] ^
     107       10550 :             C7[(int)(K[3]      ) & 0xff];
     108       10550 :         L[3] =
     109       21100 :             C0[(int)(K[3] >> 56)       ] ^
     110       21100 :             C1[(int)(K[2] >> 48) & 0xff] ^
     111       21100 :             C2[(int)(K[1] >> 40) & 0xff] ^
     112       21100 :             C3[(int)(K[0] >> 32) & 0xff] ^
     113       21100 :             C4[(int)(K[7] >> 24) & 0xff] ^
     114       21100 :             C5[(int)(K[6] >> 16) & 0xff] ^
     115       21100 :             C6[(int)(K[5] >>  8) & 0xff] ^
     116       10550 :             C7[(int)(K[4]      ) & 0xff];
     117       10550 :         L[4] =
     118       21100 :             C0[(int)(K[4] >> 56)       ] ^
     119       21100 :             C1[(int)(K[3] >> 48) & 0xff] ^
     120       21100 :             C2[(int)(K[2] >> 40) & 0xff] ^
     121       21100 :             C3[(int)(K[1] >> 32) & 0xff] ^
     122       21100 :             C4[(int)(K[0] >> 24) & 0xff] ^
     123       21100 :             C5[(int)(K[7] >> 16) & 0xff] ^
     124       21100 :             C6[(int)(K[6] >>  8) & 0xff] ^
     125       10550 :             C7[(int)(K[5]      ) & 0xff];
     126       10550 :         L[5] =
     127       21100 :             C0[(int)(K[5] >> 56)       ] ^
     128       21100 :             C1[(int)(K[4] >> 48) & 0xff] ^
     129       21100 :             C2[(int)(K[3] >> 40) & 0xff] ^
     130       21100 :             C3[(int)(K[2] >> 32) & 0xff] ^
     131       21100 :             C4[(int)(K[1] >> 24) & 0xff] ^
     132       21100 :             C5[(int)(K[0] >> 16) & 0xff] ^
     133       21100 :             C6[(int)(K[7] >>  8) & 0xff] ^
     134       10550 :             C7[(int)(K[6]      ) & 0xff];
     135       10550 :         L[6] =
     136       21100 :             C0[(int)(K[6] >> 56)       ] ^
     137       21100 :             C1[(int)(K[5] >> 48) & 0xff] ^
     138       21100 :             C2[(int)(K[4] >> 40) & 0xff] ^
     139       21100 :             C3[(int)(K[3] >> 32) & 0xff] ^
     140       21100 :             C4[(int)(K[2] >> 24) & 0xff] ^
     141       21100 :             C5[(int)(K[1] >> 16) & 0xff] ^
     142       21100 :             C6[(int)(K[0] >>  8) & 0xff] ^
     143       10550 :             C7[(int)(K[7]      ) & 0xff];
     144       10550 :         L[7] =
     145       21100 :             C0[(int)(K[7] >> 56)       ] ^
     146       21100 :             C1[(int)(K[6] >> 48) & 0xff] ^
     147       21100 :             C2[(int)(K[5] >> 40) & 0xff] ^
     148       21100 :             C3[(int)(K[4] >> 32) & 0xff] ^
     149       21100 :             C4[(int)(K[3] >> 24) & 0xff] ^
     150       21100 :             C5[(int)(K[2] >> 16) & 0xff] ^
     151       21100 :             C6[(int)(K[1] >>  8) & 0xff] ^
     152       10550 :             C7[(int)(K[0]      ) & 0xff];
     153       10550 :         K[0] = L[0];
     154       10550 :         K[1] = L[1];
     155       10550 :         K[2] = L[2];
     156       10550 :         K[3] = L[3];
     157       10550 :         K[4] = L[4];
     158       10550 :         K[5] = L[5];
     159       10550 :         K[6] = L[6];
     160       10550 :         K[7] = L[7];
     161             :         /*
     162             :          * apply the r-th round transformation:
     163             :          */
     164       10550 :         L[0] =
     165       21100 :             C0[(int)(state[0] >> 56)       ] ^
     166       21100 :             C1[(int)(state[7] >> 48) & 0xff] ^
     167       21100 :             C2[(int)(state[6] >> 40) & 0xff] ^
     168       21100 :             C3[(int)(state[5] >> 32) & 0xff] ^
     169       21100 :             C4[(int)(state[4] >> 24) & 0xff] ^
     170       21100 :             C5[(int)(state[3] >> 16) & 0xff] ^
     171       21100 :             C6[(int)(state[2] >>  8) & 0xff] ^
     172       21100 :             C7[(int)(state[1]      ) & 0xff] ^
     173       10550 :             K[0];
     174       10550 :         L[1] =
     175       21100 :             C0[(int)(state[1] >> 56)       ] ^
     176       21100 :             C1[(int)(state[0] >> 48) & 0xff] ^
     177       21100 :             C2[(int)(state[7] >> 40) & 0xff] ^
     178       21100 :             C3[(int)(state[6] >> 32) & 0xff] ^
     179       21100 :             C4[(int)(state[5] >> 24) & 0xff] ^
     180       21100 :             C5[(int)(state[4] >> 16) & 0xff] ^
     181       21100 :             C6[(int)(state[3] >>  8) & 0xff] ^
     182       21100 :             C7[(int)(state[2]      ) & 0xff] ^
     183       10550 :             K[1];
     184       10550 :         L[2] =
     185       21100 :             C0[(int)(state[2] >> 56)       ] ^
     186       21100 :             C1[(int)(state[1] >> 48) & 0xff] ^
     187       21100 :             C2[(int)(state[0] >> 40) & 0xff] ^
     188       21100 :             C3[(int)(state[7] >> 32) & 0xff] ^
     189       21100 :             C4[(int)(state[6] >> 24) & 0xff] ^
     190       21100 :             C5[(int)(state[5] >> 16) & 0xff] ^
     191       21100 :             C6[(int)(state[4] >>  8) & 0xff] ^
     192       21100 :             C7[(int)(state[3]      ) & 0xff] ^
     193       10550 :             K[2];
     194       10550 :         L[3] =
     195       21100 :             C0[(int)(state[3] >> 56)       ] ^
     196       21100 :             C1[(int)(state[2] >> 48) & 0xff] ^
     197       21100 :             C2[(int)(state[1] >> 40) & 0xff] ^
     198       21100 :             C3[(int)(state[0] >> 32) & 0xff] ^
     199       21100 :             C4[(int)(state[7] >> 24) & 0xff] ^
     200       21100 :             C5[(int)(state[6] >> 16) & 0xff] ^
     201       21100 :             C6[(int)(state[5] >>  8) & 0xff] ^
     202       21100 :             C7[(int)(state[4]      ) & 0xff] ^
     203       10550 :             K[3];
     204       10550 :         L[4] =
     205       21100 :             C0[(int)(state[4] >> 56)       ] ^
     206       21100 :             C1[(int)(state[3] >> 48) & 0xff] ^
     207       21100 :             C2[(int)(state[2] >> 40) & 0xff] ^
     208       21100 :             C3[(int)(state[1] >> 32) & 0xff] ^
     209       21100 :             C4[(int)(state[0] >> 24) & 0xff] ^
     210       21100 :             C5[(int)(state[7] >> 16) & 0xff] ^
     211       21100 :             C6[(int)(state[6] >>  8) & 0xff] ^
     212       21100 :             C7[(int)(state[5]      ) & 0xff] ^
     213       10550 :             K[4];
     214       10550 :         L[5] =
     215       21100 :             C0[(int)(state[5] >> 56)       ] ^
     216       21100 :             C1[(int)(state[4] >> 48) & 0xff] ^
     217       21100 :             C2[(int)(state[3] >> 40) & 0xff] ^
     218       21100 :             C3[(int)(state[2] >> 32) & 0xff] ^
     219       21100 :             C4[(int)(state[1] >> 24) & 0xff] ^
     220       21100 :             C5[(int)(state[0] >> 16) & 0xff] ^
     221       21100 :             C6[(int)(state[7] >>  8) & 0xff] ^
     222       21100 :             C7[(int)(state[6]      ) & 0xff] ^
     223       10550 :             K[5];
     224       10550 :         L[6] =
     225       21100 :             C0[(int)(state[6] >> 56)       ] ^
     226       21100 :             C1[(int)(state[5] >> 48) & 0xff] ^
     227       21100 :             C2[(int)(state[4] >> 40) & 0xff] ^
     228       21100 :             C3[(int)(state[3] >> 32) & 0xff] ^
     229       21100 :             C4[(int)(state[2] >> 24) & 0xff] ^
     230       21100 :             C5[(int)(state[1] >> 16) & 0xff] ^
     231       21100 :             C6[(int)(state[0] >>  8) & 0xff] ^
     232       21100 :             C7[(int)(state[7]      ) & 0xff] ^
     233       10550 :             K[6];
     234       10550 :         L[7] =
     235       21100 :             C0[(int)(state[7] >> 56)       ] ^
     236       21100 :             C1[(int)(state[6] >> 48) & 0xff] ^
     237       21100 :             C2[(int)(state[5] >> 40) & 0xff] ^
     238       21100 :             C3[(int)(state[4] >> 32) & 0xff] ^
     239       21100 :             C4[(int)(state[3] >> 24) & 0xff] ^
     240       21100 :             C5[(int)(state[2] >> 16) & 0xff] ^
     241       21100 :             C6[(int)(state[1] >>  8) & 0xff] ^
     242       21100 :             C7[(int)(state[0]      ) & 0xff] ^
     243       10550 :             K[7];
     244       10550 :         state[0] = L[0];
     245       10550 :         state[1] = L[1];
     246       10550 :         state[2] = L[2];
     247       10550 :         state[3] = L[3];
     248       10550 :         state[4] = L[4];
     249       10550 :         state[5] = L[5];
     250       10550 :         state[6] = L[6];
     251       10550 :         state[7] = L[7];
     252             :     }
     253             :     /*
     254             :      * apply the Miyaguchi-Preneel compression function:
     255             :      */
     256        1055 :     context->state[0] ^= state[0] ^ block[0];
     257        1055 :     context->state[1] ^= state[1] ^ block[1];
     258        1055 :     context->state[2] ^= state[2] ^ block[2];
     259        1055 :     context->state[3] ^= state[3] ^ block[3];
     260        1055 :     context->state[4] ^= state[4] ^ block[4];
     261        1055 :     context->state[5] ^= state[5] ^ block[5];
     262        1055 :     context->state[6] ^= state[6] ^ block[6];
     263        1055 :     context->state[7] ^= state[7] ^ block[7];
     264             : 
     265        1055 :         ZEND_SECURE_ZERO(state, sizeof(state));
     266        1055 : }
     267             : 
     268          21 : PHP_HASH_API void PHP_WHIRLPOOLInit(PHP_WHIRLPOOL_CTX *context)
     269             : {
     270          21 :         memset(context, 0, sizeof(*context));
     271          21 : }
     272             : 
     273          26 : PHP_HASH_API void PHP_WHIRLPOOLUpdate(PHP_WHIRLPOOL_CTX *context, const unsigned char *input, size_t len)
     274             : {
     275          26 :     uint64_t sourceBits = len * 8;
     276          26 :     int sourcePos    = 0; /* index of leftmost source unsigned char containing data (1 to 8 bits). */
     277          26 :     int sourceGap    = (8 - ((int)sourceBits & 7)) & 7; /* space on source[sourcePos]. */
     278          26 :     int bufferRem    = context->buffer.bits & 7; /* occupied bits on buffer[bufferPos]. */
     279          26 :     const unsigned char *source = input;
     280          26 :     unsigned char *buffer       = context->buffer.data;
     281          26 :     unsigned char *bitLength    = context->bitlength;
     282          26 :     int bufferBits   = context->buffer.bits;
     283          26 :     int bufferPos    = context->buffer.pos;
     284             :     uint32_t b, carry;
     285             :     int i;
     286             : 
     287             :     /*
     288             :      * tally the length of the added data:
     289             :      */
     290          26 :     uint64_t value = sourceBits;
     291          71 :     for (i = 31, carry = 0; i >= 0 && (carry != 0 || value != L64(0)); i--) {
     292          45 :         carry += bitLength[i] + ((uint32_t)value & 0xff);
     293          45 :         bitLength[i] = (unsigned char)carry;
     294          45 :         carry >>= 8;
     295          45 :         value >>= 8;
     296             :     }
     297             :     /*
     298             :      * process data in chunks of 8 bits (a more efficient approach would be to take whole-word chunks):
     299             :      */
     300       66330 :     while (sourceBits > 8) {
     301             :         /* N.B. at least source[sourcePos] and source[sourcePos+1] contain data. */
     302             :         /*
     303             :          * take a byte from the source:
     304             :          */
     305      132556 :         b = ((source[sourcePos] << sourceGap) & 0xff) |
     306       66278 :             ((source[sourcePos + 1] & 0xff) >> (8 - sourceGap));
     307             :         /*
     308             :          * process this byte:
     309             :          */
     310       66278 :         buffer[bufferPos++] |= (unsigned char)(b >> bufferRem);
     311       66278 :         bufferBits += 8 - bufferRem; /* bufferBits = 8*bufferPos; */
     312       66278 :         if (bufferBits == DIGESTBITS) {
     313             :             /*
     314             :              * process data block:
     315             :              */
     316        1018 :             WhirlpoolTransform(context);
     317             :             /*
     318             :              * reset buffer:
     319             :              */
     320        1018 :             bufferBits = bufferPos = 0;
     321             :         }
     322       66278 :         buffer[bufferPos] = (unsigned char) (b << (8 - bufferRem));
     323       66278 :         bufferBits += bufferRem;
     324             :         /*
     325             :          * proceed to remaining data:
     326             :          */
     327       66278 :         sourceBits -= 8;
     328       66278 :         sourcePos++;
     329             :     }
     330             :     /* now 0 <= sourceBits <= 8;
     331             :      * furthermore, all data (if any is left) is in source[sourcePos].
     332             :      */
     333          26 :     if (sourceBits > 0) {
     334          25 :         b = (source[sourcePos] << sourceGap) & 0xff; /* bits are left-justified on b. */
     335             :         /*
     336             :          * process the remaining bits:
     337             :          */
     338          25 :         buffer[bufferPos] |= b >> bufferRem;
     339             :     } else {
     340           1 :         b = 0;
     341             :     }
     342          26 :     if (bufferRem + sourceBits < 8) {
     343             :         /*
     344             :          * all remaining data fits on buffer[bufferPos],
     345             :          * and there still remains some space.
     346             :          */
     347           1 :         bufferBits += (int) sourceBits;
     348             :     } else {
     349             :         /*
     350             :          * buffer[bufferPos] is full:
     351             :          */
     352          25 :         bufferPos++;
     353          25 :         bufferBits += 8 - bufferRem; /* bufferBits = 8*bufferPos; */
     354          25 :         sourceBits -= 8 - bufferRem;
     355             :         /* now 0 <= sourceBits < 8;
     356             :          * furthermore, all data (if any is left) is in source[sourcePos].
     357             :          */
     358          25 :         if (bufferBits == DIGESTBITS) {
     359             :             /*
     360             :              * process data block:
     361             :              */
     362          13 :             WhirlpoolTransform(context);
     363             :             /*
     364             :              * reset buffer:
     365             :              */
     366          13 :             bufferBits = bufferPos = 0;
     367             :         }
     368          25 :         buffer[bufferPos] = (unsigned char) (b << (8 - bufferRem));
     369          25 :         bufferBits += (int)sourceBits;
     370             :     }
     371          26 :     context->buffer.bits   = bufferBits;
     372          26 :     context->buffer.pos    = bufferPos;
     373          26 : }
     374             : 
     375          20 : PHP_HASH_API void PHP_WHIRLPOOLFinal(unsigned char digest[64], PHP_WHIRLPOOL_CTX *context)
     376             : {
     377             :     int i;
     378          20 :     unsigned char *buffer      = context->buffer.data;
     379          20 :     unsigned char *bitLength   = context->bitlength;
     380          20 :     int bufferBits  = context->buffer.bits;
     381          20 :     int bufferPos   = context->buffer.pos;
     382             : 
     383             :     /*
     384             :      * append a '1'-bit:
     385             :      */
     386          20 :     buffer[bufferPos] |= 0x80U >> (bufferBits & 7);
     387          20 :     bufferPos++; /* all remaining bits on the current unsigned char are set to zero. */
     388             :     /*
     389             :      * pad with zero bits to complete (N*WBLOCKBITS - LENGTHBITS) bits:
     390             :      */
     391          20 :     if (bufferPos > WBLOCKBYTES - LENGTHBYTES) {
     392           4 :         if (bufferPos < WBLOCKBYTES) {
     393           4 :             memset(&buffer[bufferPos], 0, WBLOCKBYTES - bufferPos);
     394             :         }
     395             :         /*
     396             :          * process data block:
     397             :          */
     398           4 :         WhirlpoolTransform(context);
     399             :         /*
     400             :          * reset buffer:
     401             :          */
     402           4 :         bufferPos = 0;
     403             :     }
     404          20 :     if (bufferPos < WBLOCKBYTES - LENGTHBYTES) {
     405          20 :         memset(&buffer[bufferPos], 0, (WBLOCKBYTES - LENGTHBYTES) - bufferPos);
     406             :     }
     407          20 :     bufferPos = WBLOCKBYTES - LENGTHBYTES;
     408             :     /*
     409             :      * append bit length of hashed data:
     410             :      */
     411          20 :     memcpy(&buffer[WBLOCKBYTES - LENGTHBYTES], bitLength, LENGTHBYTES);
     412             :     /*
     413             :      * process data block:
     414             :      */
     415          20 :     WhirlpoolTransform(context);
     416             :     /*
     417             :      * return the completed message digest:
     418             :      */
     419         180 :     for (i = 0; i < DIGESTBYTES/8; i++) {
     420         160 :         digest[0] = (unsigned char)(context->state[i] >> 56);
     421         160 :         digest[1] = (unsigned char)(context->state[i] >> 48);
     422         160 :         digest[2] = (unsigned char)(context->state[i] >> 40);
     423         160 :         digest[3] = (unsigned char)(context->state[i] >> 32);
     424         160 :         digest[4] = (unsigned char)(context->state[i] >> 24);
     425         160 :         digest[5] = (unsigned char)(context->state[i] >> 16);
     426         160 :         digest[6] = (unsigned char)(context->state[i] >>  8);
     427         160 :         digest[7] = (unsigned char)(context->state[i]      );
     428         160 :         digest += 8;
     429             :     }
     430             : 
     431          20 :     ZEND_SECURE_ZERO(context, sizeof(*context));
     432          20 : }
     433             : 
     434             : const php_hash_ops php_hash_whirlpool_ops = {
     435             :         (php_hash_init_func_t) PHP_WHIRLPOOLInit,
     436             :         (php_hash_update_func_t) PHP_WHIRLPOOLUpdate,
     437             :         (php_hash_final_func_t) PHP_WHIRLPOOLFinal,
     438             :         (php_hash_copy_func_t) php_hash_copy,
     439             :         64,
     440             :         64,
     441             :         sizeof(PHP_WHIRLPOOL_CTX),
     442             :         1
     443             : };

Generated by: LCOV version 1.10

Generated at Mon, 06 May 2019 17:58:15 +0000 (998 days ago)

Copyright © 2005-2022 The PHP Group
All rights reserved.