Tabnine Logo
BswabePub
Code IndexAdd Tabnine to your IDE (free)

How to use
BswabePub
in
co.junwei.bswabe

Best Java code snippets using co.junwei.bswabe.BswabePub (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

Most used methods

  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • putExtra (Intent)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top Sublime Text 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