mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
reverting the changes to SDK
This commit is contained in:
@@ -26,11 +26,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "fakes.h"
|
||||
#include "nearby.h"
|
||||
#include "nearby_platform_se.h"
|
||||
#include "nearby_trace.h"
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
|
||||
@@ -200,27 +196,6 @@ nearby_platform_status nearby_platform_GenSec256r1Secret(
|
||||
}
|
||||
#endif /* NEARBY_PLATFORM_HAS_SE */
|
||||
|
||||
#ifndef NEARBY_PLATFORM_USE_MBEDTLS
|
||||
nearby_platform_status nearby_platform_Aes256Encrypt(const uint8_t input[16],
|
||||
uint8_t output[16],
|
||||
const uint8_t key[32]) {
|
||||
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
|
||||
int input_length = 16;
|
||||
int output_length = 16;
|
||||
uint8_t buffer[16];
|
||||
|
||||
EVP_EncryptInit(ctx, EVP_aes_256_ecb(), key, NULL);
|
||||
|
||||
if (1 !=
|
||||
EVP_EncryptUpdate(ctx, buffer, &output_length, input, input_length)) {
|
||||
return kNearbyStatusError;
|
||||
}
|
||||
memcpy(output, buffer, 16);
|
||||
EVP_CIPHER_CTX_free(ctx);
|
||||
return kNearbyStatusOK;
|
||||
}
|
||||
#endif
|
||||
|
||||
void nearby_test_fakes_SetRandomNumber(unsigned int value) {
|
||||
random_value = value;
|
||||
}
|
||||
@@ -284,4 +259,4 @@ nearby_platform_status nearby_platform_SecureElementInit() {
|
||||
random_value = 0;
|
||||
random_sequence = std::queue<uint8_t>();
|
||||
return kNearbyStatusOK;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user