Code Coverage: vinyl-cache/include/vsha256.h
 
82217aa4fc7094b3610340078afaf78cd95a8ec9
 
0
/*-
1
 * Copyright 2005 Colin Percival
2
 * All rights reserved.
3
 *
4
 * SPDX-License-Identifier: BSD-2-Clause
5
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions
8
 * are met:
9
 * 1. Redistributions of source code must retain the above copyright
10
 *    notice, this list of conditions and the following disclaimer.
11
 * 2. Redistributions in binary form must reproduce the above copyright
12
 *    notice, this list of conditions and the following disclaimer in the
13
 *    documentation and/or other materials provided with the distribution.
14
 *
15
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25
 * SUCH DAMAGE.
26
 *
27
 * $FreeBSD: head/lib/libmd/sha256.h 154479 2006-01-17 15:35:57Z phk $
28
 */
29
30
#ifndef _VSHA256_H_
31
#define _VSHA256_H_
32
33 75579
#define VSHA256_LEN             32
34 18750
#define VSHA256_DIGEST_LENGTH   32
35
36
typedef struct VSHA256Context {
37
        uint32_t state[8];
38
        uint64_t count;
39
        unsigned char buf[64];
40
} VSHA256_CTX;
41
42
void    VSHA256_Init(VSHA256_CTX *);
43
void    VSHA256_Update(VSHA256_CTX *, const void *, size_t);
44
void    VSHA256_Final(unsigned char [VSHA256_LEN], VSHA256_CTX *);
45
void    VSHA256_Test(void);
46
47
#define SHA256_LEN              VSHA256_LEN
48
#define SHA256_DIGEST_LENGTH    VSHA256_DIGEST_LENGTH
49
#define SHA256Context           VSHA256Context
50
#define SHA256_CTX              VSHA256_CTX
51
#define SHA256_Init             VSHA256_Init
52
#define SHA256_Update           VSHA256_Update
53
#define SHA256_Final            VSHA256_Final
54
#define SHA256_Test             VSHA256_Test
55
56
#endif /* !_VSHA256_H_ */