|
1 | 1 | /*
|
2 | 2 | * Copyright (c) 2019 Arduino SA. All rights reserved.
|
3 | 3 | *
|
4 |
| - * Permission is hereby granted, free of charge, to any person obtaining |
| 4 | + * Permission is hereby granted, free of charge, to any person obtaining |
5 | 5 | * a copy of this software and associated documentation files (the
|
6 | 6 | * "Software"), to deal in the Software without restriction, including
|
7 | 7 | * without limitation the rights to use, copy, modify, merge, publish,
|
8 | 8 | * distribute, sublicense, and/or sell copies of the Software, and to
|
9 | 9 | * permit persons to whom the Software is furnished to do so, subject to
|
10 | 10 | * the following conditions:
|
11 | 11 | *
|
12 |
| - * The above copyright notice and this permission notice shall be |
| 12 | + * The above copyright notice and this permission notice shall be |
13 | 13 | * included in all copies or substantial portions of the Software.
|
14 | 14 | *
|
15 |
| - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 15 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
16 | 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17 |
| - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 17 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
18 | 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
19 | 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
20 | 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
21 | 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22 | 22 | * SOFTWARE.
|
23 | 23 | */
|
24 | 24 |
|
25 |
| -#include <ArduinoBearSSL.h> |
26 | 25 | #include "SHA1.h"
|
| 26 | +#include <ArduinoBearSSL.h> |
27 | 27 |
|
28 |
| -SHA1Class::SHA1Class() : |
29 |
| - SHAClass(SHA1_BLOCK_SIZE, SHA1_DIGEST_SIZE) |
30 |
| -{ |
31 |
| -} |
| 28 | +SHA1Class::SHA1Class() : SHAClass(SHA1_BLOCK_SIZE, SHA1_DIGEST_SIZE) {} |
32 | 29 |
|
33 |
| -SHA1Class::~SHA1Class() |
34 |
| -{ |
35 |
| -} |
| 30 | +SHA1Class::~SHA1Class() {} |
36 | 31 |
|
37 |
| -int SHA1Class::begin() |
38 |
| -{ |
| 32 | +int SHA1Class::begin() { |
39 | 33 | br_sha1_init(&_ctx);
|
40 | 34 |
|
41 | 35 | return 1;
|
42 | 36 | }
|
43 | 37 |
|
44 |
| -int SHA1Class::update(const uint8_t *buffer, size_t size) |
45 |
| -{ |
| 38 | +int SHA1Class::update(const uint8_t *buffer, size_t size) { |
46 | 39 | br_sha1_update(&_ctx, buffer, size);
|
47 | 40 |
|
48 | 41 | return 1;
|
49 | 42 | }
|
50 | 43 |
|
51 |
| -int SHA1Class::end(uint8_t *digest) |
52 |
| -{ |
| 44 | +int SHA1Class::end(uint8_t *digest) { |
53 | 45 | br_sha1_out(&_ctx, digest);
|
54 | 46 |
|
55 | 47 | return 1;
|
56 | 48 | }
|
57 | 49 |
|
58 | 50 | #if !defined(ARDUINO_BEARSSL_DISABLE_SHA1)
|
59 |
| -SHA1Class SHA1; |
| 51 | +SHA1Class BearSHA1; |
60 | 52 | #endif
|
0 commit comments