0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ubuntu16.04にCP-ABEをインストールする.

Last updated at Posted at 2019-10-08

#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でなんか出てきたら完了

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?