test_class.file: tools/ot/src/test/java/dk/alexandra/fresco/tools/ot/otextension/LengthAdjustmentTest.java
test_class.identifier: LengthAdjustmentTest
test_case.body: @Test(expected = NullPointerException.class)
    public void testAdjustNullCandidate() {
      LengthAdjustment.adjust(null, 10);
    }
test_case.class_method_signature: LengthAdjustmentTest.testAdjustNullCandidate()
test_case.full_signature: @Test(expected = NullPointerException.class) public void testAdjustNullCandidate()
test_case.identifier: testAdjustNullCandidate
test_case.invocations: adjust
test_case.modifiers: @Test(expected = NullPointerException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAdjustNullCandidate()
focal_class.declarator: DIGEST_ALGO = "SHA-256"
focal_class.modifier: static final
focal_class.original_string: static final String DIGEST_ALGO = "SHA-256";
focal_class.type: String
focal_class.var_name: DIGEST_ALGO
focal_class.file: tools/ot/src/main/java/dk/alexandra/fresco/tools/ot/otextension/LengthAdjustment.java
focal_class.identifier: LengthAdjustment
focal_class.class_method_signature: LengthAdjustment.LengthAdjustment()
focal_class.full_signature: private  LengthAdjustment()
focal_class.identifier: LengthAdjustment
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  LengthAdjustment()
focal_class.class_method_signature: LengthAdjustment.adjust(byte[] candidate, int byteLength)
focal_class.full_signature: static byte[] adjust(byte[] candidate, int byteLength)
focal_class.identifier: adjust
focal_class.modifiers: static
focal_class.parameters: (byte[] candidate, int byteLength)
focal_class.return: byte[]
focal_class.signature: byte[] adjust(byte[] candidate, int byteLength)
focal_class.class_method_signature: LengthAdjustment.getDigest(String algo)
focal_class.full_signature: private static MessageDigest getDigest(String algo)
focal_class.identifier: getDigest
focal_class.modifiers: private static
focal_class.parameters: (String algo)
focal_class.return: MessageDigest
focal_class.signature: MessageDigest getDigest(String algo)
focal_class.class_method_signature: LengthAdjustment.intToBytes(int i)
focal_class.full_signature: private static byte[] intToBytes(int i)
focal_class.identifier: intToBytes
focal_class.modifiers: private static
focal_class.parameters: (int i)
focal_class.return: byte[]
focal_class.signature: byte[] intToBytes(int i)
focal_method.body: static byte[] adjust(byte[] candidate, int byteLength) {
      Objects.requireNonNull(candidate);
      if (byteLength < 0) {
        throw new IllegalArgumentException("Can not adjust length to negative length: " + byteLength);
      }
      byte[] key;
      if (candidate.length >= byteLength) {
        key = Arrays.copyOf(candidate, byteLength);
      } else {
        key = new byte[byteLength];
        int offset = 0;
        int counter = 0;
        while (offset < byteLength) {
          MessageDigest digest = getDigest(DIGEST_ALGO);
          digest.update(intToBytes(counter++));
          digest.update(candidate);
          int len = Math.min(digest.getDigestLength(), byteLength - offset);
          System.arraycopy(digest.digest(), 0, key, offset, len);
          offset += len;
        }
      }
      return key;
    }
focal_method.class_method_signature: LengthAdjustment.adjust(byte[] candidate, int byteLength)
focal_method.full_signature: static byte[] adjust(byte[] candidate, int byteLength)
focal_method.identifier: adjust
focal_method.invocations: requireNonNull copyOf getDigest update intToBytes update min getDigestLength arraycopy digest
focal_method.modifiers: static
focal_method.parameters: (byte[] candidate, int byteLength)
focal_method.return: byte[]
focal_method.signature: byte[] adjust(byte[] candidate, int byteLength)