Dragan Dosen | 7389dd0 | 2017-10-24 08:48:25 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Based on the git SHA1 Implementation. |
| 3 | * |
| 4 | * Copyright (C) 2009-2015, Linus Torvalds and others. |
| 5 | * |
| 6 | * SHA1 routine optimized to do word accesses rather than byte accesses, |
| 7 | * and to avoid unnecessary copies into the context array. |
| 8 | * |
| 9 | * This was initially based on the Mozilla SHA1 implementation, although |
| 10 | * none of the original Mozilla code remains. |
| 11 | * |
| 12 | * This library is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU Lesser General Public |
| 14 | * License as published by the Free Software Foundation, version 2.1 |
| 15 | * exclusively. |
| 16 | * |
| 17 | * This library is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 20 | * Lesser General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU Lesser General Public |
| 23 | * License along with this library; if not, write to the Free Software |
| 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 | */ |
| 26 | |
| 27 | typedef struct { |
| 28 | unsigned long long size; |
| 29 | unsigned int H[5]; |
| 30 | unsigned int W[16]; |
| 31 | } blk_SHA_CTX; |
| 32 | |
| 33 | void blk_SHA1_Init(blk_SHA_CTX *ctx); |
| 34 | void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *dataIn, unsigned long len); |
| 35 | void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx); |