** After all content has been added, invoke SHA3Final() to compute ** the final hash. The function returns a pointer to the binary ** hash value. */
| 1863 | ** hash value. |
| 1864 | */ |
| 1865 | static unsigned char *SHA3Final(SHA3Context *p){ |
| 1866 | unsigned int i; |
| 1867 | if( p->nLoaded==p->nRate-1 ){ |
| 1868 | const unsigned char c1 = 0x86; |
| 1869 | SHA3Update(p, &c1, 1); |
| 1870 | }else{ |
| 1871 | const unsigned char c2 = 0x06; |
| 1872 | const unsigned char c3 = 0x80; |
| 1873 | SHA3Update(p, &c2, 1); |
| 1874 | p->nLoaded = p->nRate - 1; |
| 1875 | SHA3Update(p, &c3, 1); |
| 1876 | } |
| 1877 | for(i=0; i<p->nRate; i++){ |
| 1878 | p->u.x[i+p->nRate] = p->u.x[i^p->ixMask]; |
| 1879 | } |
| 1880 | return &p->u.x[p->nRate]; |
| 1881 | } |
| 1882 | /* End of the hashing logic |
| 1883 | *****************************************************************************/ |
| 1884 |
no test coverage detected