Add tinycrypt 0.2.8
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/ext/tinycrypt/lib/source/utils.c b/ext/tinycrypt/lib/source/utils.c
index 147d8d4..13cc495 100644
--- a/ext/tinycrypt/lib/source/utils.c
+++ b/ext/tinycrypt/lib/source/utils.c
@@ -1,7 +1,7 @@
/* utils.c - TinyCrypt platform-dependent run-time operations */
/*
- * Copyright (C) 2015 by Intel Corporation, All Rights Reserved.
+ * Copyright (C) 2017 by Intel Corporation, All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -35,11 +35,10 @@
#include <string.h>
-#define MASK_MOST_SIG_BIT 0x80
#define MASK_TWENTY_SEVEN 0x1b
-uint32_t _copy(uint8_t *to, uint32_t to_len,
- const uint8_t *from, uint32_t from_len)
+unsigned int _copy(uint8_t *to, unsigned int to_len,
+ const uint8_t *from, unsigned int from_len)
{
if (from_len <= to_len) {
(void)memcpy(to, from, from_len);
@@ -49,7 +48,7 @@
}
}
-void _set(void *to, uint8_t val, uint32_t len)
+void _set(void *to, uint8_t val, unsigned int len)
{
(void)memset(to, val, len);
}
@@ -62,13 +61,13 @@
return ((a<<1) ^ ((a>>7) * MASK_TWENTY_SEVEN));
}
-int32_t _compare(const uint8_t *a, const uint8_t *b, size_t size)
+int _compare(const uint8_t *a, const uint8_t *b, size_t size)
{
const uint8_t *tempa = a;
const uint8_t *tempb = b;
uint8_t result = 0;
- for (uint32_t i = 0; i < size; i++) {
+ for (unsigned int i = 0; i < size; i++) {
result |= tempa[i] ^ tempb[i];
}
return result;