Skip to content

Commit

Permalink
Remove WDTs from example
Browse files Browse the repository at this point in the history
  • Loading branch information
intrbiz committed Jan 27, 2018
1 parent 11f9b1a commit 50e0346
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions examples/aesSha256Hmac/aesSha256Hmac.ino
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ SHA256 sha256;

// prints given block of given length in HEX
void printBlock(uint8_t* block, int length) {
ESP.wdtFeed();
Serial.print(" { ");
for (int i=0; i<length; i++) {
Serial.print(block[i], HEX);
Expand Down Expand Up @@ -78,7 +77,6 @@ void setup() {
uint8_t* encrypted = ivEncryptedHmac + AES_KEY_LENGTH;

// AES 128 CBC and pkcs7 padding
ESP.wdtFeed();
aes.process((uint8_t*)packet, encrypted, packetSize);

Serial.printf("Encrypted (%d bytes)", encryptedSize);
Expand Down Expand Up @@ -147,15 +145,13 @@ void setup() {
int decryptedSize = decodedSize - AES_KEY_LENGTH - SHA256HMAC_SIZE;
char decrypted[decryptedSize];
AES aesDecryptor(keyEncrypt, iv, AES::AES_MODE_128, AES::CIPHER_DECRYPT);
ESP.wdtFeed();
aesDecryptor.process((uint8_t*)decoded + AES_KEY_LENGTH, (uint8_t*)decrypted, decryptedSize);

Serial.printf("Decrypted Packet HEX (%d bytes)", decryptedSize);
printBlock((uint8_t*)decrypted, decryptedSize);

Serial.printf("Decrypted Packet (%d bytes):\n", strlen(decrypted));
Serial.println(decrypted);
ESP.wdtFeed();
}
}

Expand Down

0 comments on commit 50e0346

Please sign in to comment.