@@ -37,6 +37,9 @@ void BluetoothCryptoToolbox::printBytes(uint8_t bytes[], uint8_t length){
37
37
Serial.print (bytes[i],HEX);
38
38
}
39
39
Serial.print (' \n ' );
40
+ #else
41
+ (void )bytes;
42
+ (void )length;
40
43
#endif
41
44
}
42
45
@@ -130,7 +133,7 @@ int BluetoothCryptoToolbox::ah(uint8_t k[16], uint8_t r[3], uint8_t* result)
130
133
}
131
134
void BluetoothCryptoToolbox::testAh ()
132
135
{
133
- uint8_t irk[16 ] = {0xec ,0x02 ,0x34 ,0xa3 ,0x57 ,0xc8 ,0xad ,0x05 ,0x34 ,0x10 ,0x10 ,0xa6 ,0x0a ,0x39 ,0x7d ,0x9b };
136
+ uint8_t irk[16 ] = {0xec ,0x02 ,0x34 ,0xa3 ,0x57 ,0xc8 ,0xad ,0x05 ,0x34 ,0x10 ,0x10 ,0xa6 ,0x0a ,0x39 ,0x7d ,0x9b };
134
137
uint8_t expected_final[3 ] = {0x0d ,0xfb ,0xaa };
135
138
uint8_t ourResult[3 ];
136
139
ah (irk, expected_final, ourResult);
@@ -165,14 +168,12 @@ void BluetoothCryptoToolbox::testg2(){
165
168
uint8_t Y[16 ] = {0xa6 ,0xe8 ,0xe7 ,0xcc ,0x25 ,0xa7 ,0x5f ,0x6e ,0x21 ,0x65 ,0x83 ,0xf7 ,0xff ,0x3d ,0xc4 ,0xcf };
166
169
uint8_t out[4 ];
167
170
168
- uint32_t expected = 0 ;
169
171
g2 (U,V,X,Y,out);
170
172
uint32_t result = 0 ;
171
173
for (int i=0 ; i<4 ; i++) result += out[i] << 8 *i;
172
174
173
175
#ifdef _BLE_TRACE_
174
- Serial.print (" Expected : " );
175
- Serial.println (expected);
176
+ Serial.println (" Expected : 0" );
176
177
Serial.print (" Result : " );
177
178
Serial.println (result);
178
179
Serial.println ();
@@ -383,4 +384,4 @@ void BluetoothCryptoToolbox::xor_128(unsigned char *a, unsigned char *b, unsigne
383
384
out[i] = a[i] ^ b[i];
384
385
}
385
386
}
386
- BluetoothCryptoToolbox btct;
387
+ BluetoothCryptoToolbox btct;
0 commit comments