projects
/
shamirs
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tweak, build.sh
[shamirs]
/
shamirssecret.c
diff --git
a/shamirssecret.c
b/shamirssecret.c
index cc3e71334a1277367c2beae82bd05f9496945287..be6eed3f9d0c4247dc09a6a7d27fa0f775a32396 100644
(file)
--- a/
shamirssecret.c
+++ b/
shamirssecret.c
@@
-102,6
+102,11
@@
static uint8_t field_pow_ret(uint8_t calc, uint8_t a, uint8_t e) {
return ret;
}
static uint8_t field_pow(uint8_t a, uint8_t e) {
return ret;
}
static uint8_t field_pow(uint8_t a, uint8_t e) {
+#ifndef TEST
+ // Although this function works for a==0, its not trivially obvious why,
+ // and since we never call with a==0, we just assert a != 0 (except when testing)
+ assert(a != 0);
+#endif
return field_pow_ret(exp[(log[a] * e) % 255], a, e);
}
return field_pow_ret(exp[(log[a] * e) % 255], a, e);
}