File tree 3 files changed +14
-14
lines changed
3 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- ArduinoBearSSL SHA1
2
+ ArduinoBearSSL BearSHA1
3
3
4
- This sketch demonstrates how to create a SHA1 hash and HMAC
4
+ This sketch demonstrates how to create a BearSHA1 hash and HMAC
5
5
for an input string.
6
6
7
7
This example code is in the public domain.
@@ -30,35 +30,35 @@ void loop() {
30
30
}
31
31
32
32
void printSHA1 (const char * str) {
33
- Serial.print (" SHA1 of '" );
33
+ Serial.print (" BearSHA1 of '" );
34
34
Serial.print (str);
35
35
Serial.print (" ' is 0x" );
36
36
37
- SHA1 .beginHash ();
38
- SHA1 .print (str);
39
- SHA1 .endHash ();
37
+ BearSHA1 .beginHash ();
38
+ BearSHA1 .print (str);
39
+ BearSHA1 .endHash ();
40
40
41
41
printResult ();
42
42
}
43
43
44
44
void printHMACSHA1 (const char * secret, const char * str) {
45
- Serial.print (" HMAC-SHA1 of '" );
45
+ Serial.print (" HMAC-BearSHA1 of '" );
46
46
Serial.print (str);
47
47
Serial.print (" ' with secret '" );
48
48
Serial.print (secret);
49
49
Serial.print (" ' is 0x" );
50
50
51
- SHA1 .beginHmac (secret);
52
- SHA1 .print (str);
53
- SHA1 .endHmac ();
51
+ BearSHA1 .beginHmac (secret);
52
+ BearSHA1 .print (str);
53
+ BearSHA1 .endHmac ();
54
54
55
55
printResult ();
56
56
}
57
57
58
58
void printResult ()
59
59
{
60
- while (SHA1 .available ()) {
61
- byte b = SHA1 .read ();
60
+ while (BearSHA1 .available ()) {
61
+ byte b = BearSHA1 .read ();
62
62
63
63
if (b < 16 ) {
64
64
Serial.print (" 0" );
Original file line number Diff line number Diff line change @@ -54,4 +54,4 @@ int SHA1Class::end(uint8_t *digest)
54
54
return 1 ;
55
55
}
56
56
57
- SHA1Class SHA1 ;
57
+ SHA1Class BearSHA1 ;
Original file line number Diff line number Diff line change @@ -47,6 +47,6 @@ class SHA1Class: public SHAClass {
47
47
br_sha1_context _ctx;
48
48
};
49
49
50
- extern SHA1Class SHA1 ;
50
+ extern SHA1Class BearSHA1 ;
51
51
52
52
#endif
You can’t perform that action at this time.
0 commit comments