An implementation for the calculation of the RA Mechanism could look like the following one:
funcalculateRaMechanism(verifier_suites: Array<String>, prover_suites: Array<String>): String? {if (verifier_suites.isNullOrEmpty() || prover_suites.isNullOrEmpty()) {returnnull; }for (v in verifier_suites) {for (p in prover_suites) {if (p == s) {// found a matchreturn p } } }// no matchreturnnull}
This is then called twice to calculate both, the local RaVerifier and the local RaProver mechanism: