OLD | NEW |
1 /* SHA-256 and SHA-512 implementation based on code by Oliver Gay | 1 /* SHA-256 and SHA-512 implementation based on code by Oliver Gay |
2 * <olivier.gay@a3.epfl.ch> under a BSD-style license. See below. | 2 * <olivier.gay@a3.epfl.ch> under a BSD-style license. See below. |
3 */ | 3 */ |
4 | 4 |
5 /* | 5 /* |
6 * FIPS 180-2 SHA-224/256/384/512 implementation | 6 * FIPS 180-2 SHA-224/256/384/512 implementation |
7 * Last update: 02/02/2007 | 7 * Last update: 02/02/2007 |
8 * Issue date: 04/30/2005 | 8 * Issue date: 04/30/2005 |
9 * | 9 * |
10 * Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch> | 10 * Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch> |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 int i; | 614 int i; |
615 SHA512_CTX ctx; | 615 SHA512_CTX ctx; |
616 SHA512_init(&ctx); | 616 SHA512_init(&ctx); |
617 SHA512_update(&ctx, data, len); | 617 SHA512_update(&ctx, data, len); |
618 p = SHA512_final(&ctx); | 618 p = SHA512_final(&ctx); |
619 for (i = 0; i < SHA512_DIGEST_SIZE; ++i) { | 619 for (i = 0; i < SHA512_DIGEST_SIZE; ++i) { |
620 digest[i] = *p++; | 620 digest[i] = *p++; |
621 } | 621 } |
622 return digest; | 622 return digest; |
623 } | 623 } |
OLD | NEW |