| Electronic Components Datasheet Search |
|
DEV-15573 Datasheet(PDF) 26 Page - SparkFun Electronics |
|
|
|||||||||||||||||||||||||||||
DEV-15573 Datasheet(HTML) 26 Page - SparkFun Electronics |
|
26 / 31 page ![]() void loop() { if (Serial1.available() > 0) // listen on Serial1 { // check for start header byte input = Serial1.read(); //Serial.print(input, HEX); if (input == ') headerCount++; if (headerCount == 3) { delay(100); // wait for entire message to come into Serial1 buffer (96 bytes at 9600 bau d). headerCount = 0; // reset Serial.println("Message Received!"); Serial.println(); for (int bytes = 0 ; bytes < 32 ; bytes++) message[bytes] = Serial1.read(); for (int bytes = 0 ; bytes < 64 ; bytes++) signature[bytes] = Serial1.read(); printMessage(); printSignature(); // Let's verirfy! if (atecc.verifySignature(message, signature, AlicesPublicKey)) Serial.println("Success! S ignature Verified."); else Serial.println("Verification failure."); } } } Above, we have Bob's entire loop() . He is listening for incoming data on his RX1 pin. If he hears the expected $$$ , then he starts reading in the message and the signature, storing them in variables for later use. Then Bob uses the atecc.verifySignature() function to see if everything is authentic. Note his third argument to this function - he is using AlicesPublicKey! Example 5: Random This example shows how to use the Random Number Generator on the Sparkfun Cryptographic Co-processor. It will print random numbers once a second on the serial terminal at 115200. This example only requires 1 Artemis and 1 co-processor. If you just completed example 4, you can choose to use Alice or Bob. This example helps set the stage for Example 6, so it's a good idea to check it out and see how the ATECC508A does random numbers - particularly its ability to create 32 bytes of random data! |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |