projects
/
shamirs
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1be5bb4
)
-Wall -Werror
author
Matt Corallo
<git@bluematt.me>
Sat, 7 Sep 2013 03:03:23 +0000
(23:03 -0400)
committer
Matt Corallo
<git@bluematt.me>
Thu, 5 Sep 2013 14:59:37 +0000
(10:59 -0400)
build.sh
patch
|
blob
|
history
shamirssecret.c
patch
|
blob
|
history
diff --git
a/build.sh
b/build.sh
index b473a52e5574a8bf2869b9e77b0cce2e1d57dba2..47c76de06df83df03e3ca30c0c12e729a39b5207 100755
(executable)
--- a/
build.sh
+++ b/
build.sh
@@
-1,3
+1,3
@@
#!/bin/sh
#!/bin/sh
-
gcc shamirssecret.c
-O2 -std=c99 -DTEST -o shamirssecret && ./shamirssecret &&
-
gcc shamirssecret.c
-O2 -std=c99 -o shamirssecret
+
$CC shamirssecret.c $CFLAGS -Wall -Werror
-O2 -std=c99 -DTEST -o shamirssecret && ./shamirssecret &&
+
$CC shamirssecret.c $CFLAGS -Wall -Werror
-O2 -std=c99 -o shamirssecret
diff --git
a/shamirssecret.c
b/shamirssecret.c
index 80f835c46318bb2ab825a40135af853d51b96821..277ecb11ab30951a9f496d07bc324f4203483b0e 100644
(file)
--- a/
shamirssecret.c
+++ b/
shamirssecret.c
@@
-16,6
+16,7
@@
*/
#define P 256
*/
#define P 256
+#ifndef TEST
static uint8_t field_add(uint8_t a, uint8_t b) {
return a ^ b;
}
static uint8_t field_add(uint8_t a, uint8_t b) {
return a ^ b;
}
@@
-27,6
+28,7
@@
static uint8_t field_sub(uint8_t a, uint8_t b) {
static uint8_t field_neg(uint8_t a) {
return field_sub(0, a);
}
static uint8_t field_neg(uint8_t a) {
return field_sub(0, a);
}
+#endif
static const uint8_t exp[P] = {
0x01, 0x03, 0x05, 0x0f, 0x11, 0x33, 0x55, 0xff, 0x1a, 0x2e, 0x72, 0x96, 0xa1, 0xf8, 0x13, 0x35,
static const uint8_t exp[P] = {
0x01, 0x03, 0x05, 0x0f, 0x11, 0x33, 0x55, 0xff, 0x1a, 0x2e, 0x72, 0x96, 0xa1, 0xf8, 0x13, 0x35,