Examples of nextBytes()


Examples of com.orientechnologies.common.util.MersenneTwisterFast.nextBytes()

    for (OClusterPosition clusterPosition : positionRecordMap.keySet()) {
      if (mersenneTwisterFast.nextBoolean()) {
        int recordSize = mersenneTwisterFast.nextInt(2 * OClusterPage.MAX_RECORD_SIZE) + 1;
        byte[] record = new byte[recordSize];
        mersenneTwisterFast.nextBytes(record);

        paginatedCluster.updateRecord(clusterPosition, record, newRecordVersion, (byte) 3);

        positionRecordMap.put(clusterPosition, record);
        updatedPositions.add(clusterPosition);
View Full Code Here

Examples of freenet.crypt.DummyRandomSource.nextBytes()

        //isSSK = true;
       
        // Now create a key.
       
        byte[] buf = new byte[32];
        random.nextBytes(buf);
        String keyName = HexUtil.bytesToHex(buf);
       
        FreenetURI testKey;
        ClientKey insertKey;
        ClientKey fetchKey;
View Full Code Here

Examples of freenet.crypt.RandomSource.nextBytes()

      ipOverride = args[0];
        File dir = new File("bootstrap-pull-test");
        FileUtil.removeAll(dir);
        RandomSource random = NodeStarter.globalTestInit(dir.getPath(), false, LogLevel.ERROR, "", false);
        byte[] seed = new byte[64];
        random.nextBytes(seed);
        MersenneTwister fastRandom = new MersenneTwister(seed);
        File seednodes = new File("seednodes.fref");
        if(!seednodes.exists() || seednodes.length() == 0 || !seednodes.canRead()) {
          System.err.println("Unable to read seednodes.fref, it doesn't exist, or is empty");
          System.exit(EXIT_NO_SEEDNODES);
View Full Code Here

Examples of freenet.support.math.MersenneTwister.nextBytes()

 
  public void testEncodeDecodeFullBlock() throws CHKEncodeException, CHKVerifyException, CHKDecodeException, UnsupportedEncodingException, InvalidCompressionCodecException, IOException {
    byte[] fullBlock = new byte[CHKBlock.DATA_LENGTH];
    MersenneTwister random = new MersenneTwister(42);
    for(int i=0;i<10;i++) {
      random.nextBytes(fullBlock);
      checkBlock(fullBlock, false);
      checkBlock(fullBlock, true);
    }
  }
 
View Full Code Here

Examples of gnu.java.security.prng.EntropySource.nextBytes()

            return;
          if (other_it.hasNext())
            try
              {
                EntropySource src = (EntropySource) other_it.next();
                byte[] buf = src.nextBytes();
                if (pool == null)
                  return;
                pool.addRandomBytes(buf, 0, buf.length);
                pool.addQuality(src.quality());
                if (Configuration.DEBUG)
View Full Code Here

Examples of gnu.java.security.prng.IRandom.nextBytes()

        attrib.put(ARCFour.ARCFOUR_KEY_MATERIAL, new byte[0]);
        byte[] b1 = new byte[16];
        byte[] b2 = new byte[16];
        IRandom r1 = PRNGFactory.getInstance(Registry.ARCFOUR_PRNG);
        r1.init(attrib);
        r1.nextBytes(b1, 0, b1.length);
        IRandom r2 = (IRandom) r1.clone();
        r1.nextBytes(b1, 0, b1.length);
        r2.nextBytes(b2, 0, b1.length);
        harness.check(Arrays.equals(b1, b2));
      }
View Full Code Here

Examples of gnu.java.security.util.PRNG.nextBytes()

      PRNG prng = PRNG.getInstance();

      byte buffer[] = new byte[40];

      prng.nextBytes(buffer, 0, buffer.length);

      for(int i = 0; i != buffer.length; ++i)
         {
         // There must be an easier way to do this (right?)
         int intval = buffer[i];
View Full Code Here

Examples of gnu.javax.crypto.prng.PBKDF2.nextBytes()

        attr.put(IPBE.PASSWORD, password);
        attr.put(IPBE.SALT, salt);
        try
          {
            kdf.init(attr);
            kdf.nextBytes(dk, 0, dk.length);
            harness.check(Arrays.equals(dk, edk));
          }
        catch (Exception x)
          {
            harness.debug(x);
View Full Code Here

Examples of java.net.URL.nextBytes()

            return;
          if (other_it.hasNext())
            try
              {
                EntropySource src = (EntropySource) other_it.next();
                byte[] buf = src.nextBytes();
                if (pool == null)
                  return;
                pool.addRandomBytes(buf, 0, buf.length);
                pool.addQuality(src.quality());
                if (Configuration.DEBUG)
View Full Code Here

Examples of java.security.SecureRandom.nextBytes()

        SecureRandom ng=numberGenerator;
        if(ng == null)
            numberGenerator=ng=new SecureRandom();

        byte[] randomBytes=new byte[16];
        ng.nextBytes(randomBytes);
        return randomBytes;
    }

    public int size() {
        int retval=super.size() + Global.BYTE_SIZE;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.