Class IdemixUtils



  • public final class IdemixUtils
    extends java.lang.Object
    The class IdemixUtils consists of all needed utility functions for Idemix. The class uses the apache milagro crypto library.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] bigToBytes​(org.apache.milagro.amcl.FP256BN.BIG big)
      bigToBytes turns a BIG into a byte array
      static org.apache.milagro.amcl.RAND getRand​()
      Returns a random number generator, amcl.RAND, initialized with a fresh seed.
      static org.apache.milagro.amcl.FP256BN.BIG hashModOrder​(byte[] data)
      hashModOrder hashes bytes to an amcl.BIG in 0, ..., GROUP_ORDER
      static org.apache.milagro.amcl.FP256BN.BIG randModOrder​(org.apache.milagro.amcl.RAND rng)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getRand

        public static org.apache.milagro.amcl.RAND getRand​()
        Returns a random number generator, amcl.RAND, initialized with a fresh seed.
        Returns:
        a random number generator
      • randModOrder

        public static org.apache.milagro.amcl.FP256BN.BIG randModOrder​(org.apache.milagro.amcl.RAND rng)
        Returns:
        a random BIG in 0, ..., GROUP_ORDER-1
      • hashModOrder

        public static org.apache.milagro.amcl.FP256BN.BIG hashModOrder​(byte[] data)
        hashModOrder hashes bytes to an amcl.BIG in 0, ..., GROUP_ORDER
        Parameters:
        data - the data to be hashed
        Returns:
        a BIG in 0, ..., GROUP_ORDER-1 that is the hash of the data
      • bigToBytes

        public static byte[] bigToBytes​(org.apache.milagro.amcl.FP256BN.BIG big)
        bigToBytes turns a BIG into a byte array
        Parameters:
        big - the BIG to turn into bytes
        Returns:
        a byte array representation of the BIG