source: examples/scaling_tests/haystack/fruit_prover/base/README @ af8e9b9

abac0-leakabac0-meimei-idmei-rt0-nmei_rt0tvf-new-xml
Last change on this file since af8e9b9 was 7e3f5e2, checked in by Mei <mei@…>, 12 years ago

1) converted daisychain scaling tests

  • Property mode set to 100755
File size: 3.6 KB
RevLine 
[7e3f5e2]1#!/bin/sh
2#
3#  This demonstrates scalability of libabac. The fruit_rt2 test from
4#  creddy_prover_tests is use as the base.
5#       #VAL# simple attribute credentials are added,
6#       #VAL# complex attribute credentials along
7#             with #VAL# different principal ids are added.
8#  The same queries used in fruit_rt2 are run against this setup and
9#  should  yield the same result
10# number of credentials, 3 + 6 + 3 x #VAL#
11
12
13# fruits_rt2_creddy
14
15# mary.what2eat<-?-navel orange  good
16# mary.what2eat<-?-kiwi  good
17# bob.what2eat<-?-navel orange  bad
18# ralphs.fruitprice(1.50)<-?-apple   good
19# ralphs.fruitprice(1.50)<-?-green apple   bad
20
21creddy --generate --cn Mary
22creddy --generate --cn Bob
23creddy --generate --cn Ralphs
24
25fruitprice_qP="fruitprice([float:?P:[..2.00]])"
26fruitprice_qP_2="fruitprice([float:?P:[1.00..5.00]])"
27
28# [keyid:mary].oset:what2eat
29#      <- [keyid:ralphs].oset:fruitprice([float:?P:[..2.00]])
30# Credential 1
31creddy --attribute \
32       --issuer Mary_ID.pem --key Mary_private.pem --oset "what2eat" \
33       --subject-cert Ralphs_ID.pem --subject-oset "$fruitprice_qP" \
34       --out mary_what2eat__ralphs_fruitprice_qP_attr.der
35
36# [keyid:bob].oset:what2eat
37#      <- [keyid:ralphs].oset:fruitprice([float:?P:[1.00..5.00]])
38# Credential 2
39creddy --attribute \
40       --issuer Bob_ID.pem --key Bob_private.pem --oset "what2eat" \
41       --subject-cert Ralphs_ID.pem --subject-oset "$fruitprice_qP_2" \
42       --out bob_what2eat__ralphs_fruitprice_qP_2_attr.der
43
44# [keyid:ralphs].oset:fruitprice([float:1.50]) <- [string:'apple']
45# Credential 3
46creddy --attribute \
47        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
48        --oset "fruitprice([float:1.50])" \
49        --subject-obj "[string:'apple']" \
50        --out Ralphs_fruitprice__apple_attr.der
51
52# [keyid:ralphs].oset:fruitprice([float:1.50]) <- [string:'kiwi']
53# Credential 4
54creddy --attribute \
55        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
56        --oset "fruitprice([float:1.50])" \
57        --subject-obj "[string:'kiwi']" \
58        --out Ralphs_fruitprice__kiwi_attr.der
59
60
61# [keyid:ralphs].oset:fruitprice([float:2.50]) <- [string:'black rasberry']
62# Credential 5
63creddy --attribute \
64        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
65        --oset "fruitprice([float:2.50])" \
66        --subject-obj "[string:'black rasberry']" \
67        --out Ralphs_fruitprice__black_rasberry_attr.der
68
69# [keyid:ralphs].oset:fruitprice([float:0.50]) <- [string:'navel orange']
70# Credential 6
71creddy --attribute \
72        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
73        --oset "fruitprice([float:0.50])" \
74        --subject-obj "[string:'navel orange']" \
75        --out Ralphs_fruitprice__navel_orange_attr.der
76
77############### NOISE #######################################
78# [keyid:Ralphs].oset:fruitprice([float:X.00])  <- [string:bananaY]
79for i in $(seq 1 #VAL#);
80do
81  fruit="banana$i"
82  price="fruitprice([float:$i.00])"
83  stuff="[string:'$fruit']"
84  ostr="Ralphs_fruitprice__${fruit}_attr.der"
85  creddy --attribute \
86        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
87        --oset "$price" \
88        --subject-obj "$stuff" \
89        --out $ostr
90done
91
92# [keyid:johnX]
93# [keyid:johnX].oset:what2eat
94#               <- [keyid:ralphs].oset:fruitprice([float:?P:[1.00..5.00]])
95for i in $(seq 1 #VAL#);
96do
97  name="John$i"
98creddy --generate --cn $name
99
100  ostr="${name}_what2eat__ralphs_fruitprice_qP_2_attr.der"
101creddy --attribute \
102       --issuer ${name}_ID.pem --key ${name}_private.pem --oset "what2eat" \
103       --subject-cert Ralphs_ID.pem --subject-oset "$fruitprice_qP_2" \
104       --out $ostr
105done
106
Note: See TracBrowser for help on using the repository browser.