forked from adafruit/circuitpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHash.h
More file actions
36 lines (27 loc) · 704 Bytes
/
Copy pathHash.h
File metadata and controls
36 lines (27 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2022 Jeff Epler for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
#include "mbedtls/version.h"
#if MBEDTLS_VERSION_MAJOR >= 4
#include "psa/crypto.h"
typedef struct {
mp_obj_base_t base;
psa_hash_operation_t hash_op;
psa_algorithm_t hash_alg;
} hashlib_hash_obj_t;
#else
#include "mbedtls/sha1.h"
#include "mbedtls/sha256.h"
typedef struct {
mp_obj_base_t base;
union {
mbedtls_sha1_context sha1;
mbedtls_sha256_context sha256;
};
// Of MBEDTLS_SSL_HASH_*
uint8_t hash_type;
} hashlib_hash_obj_t;
#endif