Class: RSA::ACC::MembershipProof
- Inherits:
-
Object
- Object
- RSA::ACC::MembershipProof
- Includes:
- Functions
- Defined in:
- lib/rsa/acc/proof.rb
Overview
Proof of membership of the element’s inclusion in the accumulator.
Instance Attribute Summary collapse
-
#acc_value ⇒ Object
readonly
Returns the value of attribute acc_value.
-
#element ⇒ Object
readonly
witness^H(element) == acc.
-
#proof ⇒ Object
readonly
prof calculated by PoE.
-
#witness ⇒ Object
readonly
Returns the value of attribute witness.
Instance Method Summary collapse
-
#element_prime ⇒ Integer
Convert element to prime number.
-
#initialize(element, witness, acc_value, proof) ⇒ MembershipProof
constructor
A new instance of MembershipProof.
Methods included from Functions
#blake2_hash, #compute_challenge, #egcd, #elements_to_prime, #hash_to_prime, #shamir_trick
Constructor Details
#initialize(element, witness, acc_value, proof) ⇒ MembershipProof
Returns a new instance of MembershipProof.
15 16 17 18 19 20 |
# File 'lib/rsa/acc/proof.rb', line 15 def initialize(element, witness, acc_value, proof) @element = element @witness = witness @acc_value = acc_value @proof = proof end |
Instance Attribute Details
#acc_value ⇒ Object (readonly)
Returns the value of attribute acc_value.
12 13 14 |
# File 'lib/rsa/acc/proof.rb', line 12 def acc_value @acc_value end |
#element ⇒ Object (readonly)
witness^H(element) == acc
10 11 12 |
# File 'lib/rsa/acc/proof.rb', line 10 def element @element end |
#proof ⇒ Object (readonly)
prof calculated by PoE
13 14 15 |
# File 'lib/rsa/acc/proof.rb', line 13 def proof @proof end |
#witness ⇒ Object (readonly)
Returns the value of attribute witness.
11 12 13 |
# File 'lib/rsa/acc/proof.rb', line 11 def witness @witness end |
Instance Method Details
#element_prime ⇒ Integer
Convert element to prime number.
24 25 26 27 |
# File 'lib/rsa/acc/proof.rb', line 24 def element_prime return nil if element.nil? element.is_a?(Array) ? elements_to_prime(element) : hash_to_prime(element) end |