#ubuntu16.04にCP-ABEをインストールする方法
cp-abeのmakeに失敗するから忘れないように書いておく
必要なもの
1:cp-abe
http://acsc.cs.utexas.edu/cpabe/
2:libbswabe
http://acsc.cs.utexas.edu/cpabe/libbswabe-0.9.tar.gz
3:pbc
https://crypto.stanford.edu/pbc/
4:gmp
https://gmplib.org/
解凍
$tar -zxvf hogehoge.tar.gz
$tar --lzip -xvf hogehoge.tar.lz
cp-abe以外を適当な順番で
./configure
make
make install
する。エラーでたら頑張って
cp-abeのインストールでコンパイルするとエラーが発生する.
./configure
make LDFLAGS="-lgmp -lpbc -lcrypto -L/usr/lib/x86_64-linux-gnu -lglib-2.0 -lbswabe -lgmp"
policy_lang.y: In function ‘yyparse’:
policy_lang.y:67:38: error: expected ‘;’ before ‘}’ token
policy_lang.y: In function ‘eq_policy’:
policy_lang.y:212:21: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
(g_strdup_printf("%s_flexint_%llu", attr, n->value));
^
policy_lang.y:215:21: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
(g_strdup_printf("%s_expint%02d_%llu", attr, n->bits, n->value));
^
policy_lang.y: In function ‘yylex’:
policy_lang.y:391:18: warning: format ‘%llu’ expects argument of type ‘long long unsigned int *’, but argument 3 has type ‘uint64_t * {aka long unsigned int *}’ [-Wformat=]
sscanf(s->str, "%llu", &(yylval.nat));
^
policy_lang.y: In function ‘parse_attribute’:
policy_lang.y:577:17: warning: format ‘%llu’ expects argument of type ‘long long unsigned int *’, but argument 4 has type ‘uint64_t * {aka long unsigned int *}’ [-Wformat=]
if( sscanf(a, " %s = %llu # %u ", s, &value, &bits) == 3 )
^
policy_lang.y:596:26: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
(*l, g_strdup_printf("%s_expint%02d_%llu", s, bits, value));
^
policy_lang.y:598:22: warning: format ‘%llu’ expects argument of type ‘long long unsigned int *’, but argument 4 has type ‘uint64_t * {aka long unsigned int *}’ [-Wformat=]
else if( sscanf(a, " %s = %llu ", s, &value) == 2 )
^
policy_lang.y:612:26: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
(*l, g_strdup_printf("%s_flexint_%llu", s, value));
^
Makefile:49: ターゲット 'policy_lang.o' のレシピで失敗しました
make: *** [policy_lang.o] エラー 1
policy_lang.yの67行目を
result: policy { final_policy = $1; }
こんな感じに直す.
するとコンパイルできるから
あとは
make install
でインストールできる.
cpabe-encでなんか出てきたら完了