Tabnine Logo
BswabePub.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
co.junwei.bswabe.BswabePub
constructor

Best Java code snippets using co.junwei.bswabe.BswabePub.<init> (Showing top 3 results out of 315)

origin: junwei-wang/cpabe

/**
 * @param
 * @author Junwei Wang(wakemecn@gmail.com)
 */
public void setup(String pubfile, String mskfile) throws IOException,
    ClassNotFoundException {
  byte[] pub_byte, msk_byte;
  BswabePub pub = new BswabePub();
  BswabeMsk msk = new BswabeMsk();
  Bswabe.setup(pub, msk);
  /* store BswabePub into mskfile */
  pub_byte = SerializeUtils.serializeBswabePub(pub);
  Common.spitFile(pubfile, pub_byte);
  /* store BswabeMsk into mskfile */
  msk_byte = SerializeUtils.serializeBswabeMsk(msk);
  Common.spitFile(mskfile, msk_byte);
}
origin: junwei-wang/cpabe

public static BswabePub unserializeBswabePub(byte[] b) {
  BswabePub pub;
  int offset;

  pub = new BswabePub();
  offset = 0;

  StringBuffer sb = new StringBuffer("");
  offset = unserializeString(b, offset, sb);
  pub.pairingDesc = sb.substring(0);

  CurveParameters params = new DefaultCurveParameters()
      .load(new ByteArrayInputStream(pub.pairingDesc.getBytes()));
  pub.p = PairingFactory.getPairing(params);
  Pairing pairing = pub.p;

  pub.g = pairing.getG1().newElement();
  pub.h = pairing.getG1().newElement();
  pub.gp = pairing.getG2().newElement();
  pub.g_hat_alpha = pairing.getGT().newElement();

  offset = unserializeElement(b, offset, pub.g);
  offset = unserializeElement(b, offset, pub.h);
  offset = unserializeElement(b, offset, pub.gp);
  offset = unserializeElement(b, offset, pub.g_hat_alpha);

  return pub;
}
origin: junwei-wang/cpabe

public static void main(String[] args) throws Exception {
  BswabePub pub = new BswabePub();
  BswabeMsk msk = new BswabeMsk();
  BswabePrv prv, prv_delegate_ok, prv_delegate_ko;
co.junwei.bswabeBswabePub<init>

Popular methods of BswabePub

    Popular in Java

    • Running tasks concurrently on multiple threads
    • findViewById (Activity)
    • orElseThrow (Optional)
      Return the contained value, if present, otherwise throw an exception to be created by the provided s
    • getSharedPreferences (Context)
    • HttpURLConnection (java.net)
      An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
    • Charset (java.nio.charset)
      A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
    • SimpleDateFormat (java.text)
      Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
    • Map (java.util)
      A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
    • SortedMap (java.util)
      A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
    • JTable (javax.swing)
    • Top Vim plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now