congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SHA1$State
Code IndexAdd Tabnine to your IDE (free)

How to use
SHA1$State
in
org.eclipse.jgit.util.sha1

Best Java code snippets using org.eclipse.jgit.util.sha1.SHA1$State (Showing top 14 results out of 315)

origin: org.eclipse.jgit/org.eclipse.jgit

{ b = rotateRight( b, 30);  e -= s1(a, b, c, d,w2[ 0]);}
hIn.save(a, b, c, d, e);
a = s.a; b = s.b; c = s.c; d = s.d; e = s.e;
hTmp.save(hIn.a + a, hIn.b + b, hIn.c + c, hIn.d + d, hIn.e + e);
origin: org.eclipse.jgit/org.eclipse.jgit

private void finish() {
  int bufferLen = (int) (length & 63);
  if (bufferLen > 55) {
    // Last block is too small; pad, compress, pad another block.
    buffer[bufferLen++] = (byte) 0x80;
    Arrays.fill(buffer, bufferLen, 64, (byte) 0);
    compress(buffer, 0);
    Arrays.fill(buffer, 0, 56, (byte) 0);
  } else {
    // Last block can hold padding and length.
    buffer[bufferLen++] = (byte) 0x80;
    Arrays.fill(buffer, bufferLen, 56, (byte) 0);
  }
  // SHA-1 appends the length of the message in bits after the
  // padding block (above). Here length is in bytes. Multiply by
  // 8 by shifting by 3 as part of storing the 64 bit byte length
  // into the two words expected in the trailer.
  NB.encodeInt32(buffer, 56, (int) (length >>> (32 - 3)));
  NB.encodeInt32(buffer, 60, (int) (length << 3));
  compress(buffer, 0);
  if (foundCollision) {
    ObjectId id = h.toObjectId();
    LOG.warn("possible SHA-1 collision " + id.name()); //$NON-NLS-1$
    throw new Sha1CollisionException(id);
  }
}
origin: berlam/github-bucket

{ b = rotateRight( b, 30);  e -= s1(a, b, c, d,w2[ 0]);}
hIn.save(a, b, c, d, e);
a = s.a; b = s.b; c = s.c; d = s.d; e = s.e;
hTmp.save(hIn.a + a, hIn.b + b, hIn.c + c, hIn.d + d, hIn.e + e);
origin: berlam/github-bucket

 d += s3(e, a, b, c,w[ 56]);  a = rotateLeft( a, 30);
 c += s3(d, e, a, b,w[ 57]);  e = rotateLeft( e, 30);
state58.save(a, b, c, d, e);
 b += s3(c, d, e, a,w[ 58]);  d = rotateLeft( d, 30);
 a += s3(b, c, d, e,w[ 59]);  c = rotateLeft( c, 30);
 b += s4(c, d, e, a,w[ 63]);  d = rotateLeft( d, 30);
 a += s4(b, c, d, e,w[ 64]);  c = rotateLeft( c, 30);
state65.save(a, b, c, d, e);
 e += s4(a, b, c, d,w[ 65]);  b = rotateLeft( b, 30);
 d += s4(e, a, b, c,w[ 66]);  a = rotateLeft( a, 30);
h.save(h.a + a, h.b + b, h.c + c, h.d + d, h.e + e);
origin: berlam/github-bucket

private void finish() {
  int bufferLen = (int) (length & 63);
  if (bufferLen > 55) {
    // Last block is too small; pad, compress, pad another block.
    buffer[bufferLen++] = (byte) 0x80;
    Arrays.fill(buffer, bufferLen, 64, (byte) 0);
    compress(buffer, 0);
    Arrays.fill(buffer, 0, 56, (byte) 0);
  } else {
    // Last block can hold padding and length.
    buffer[bufferLen++] = (byte) 0x80;
    Arrays.fill(buffer, bufferLen, 56, (byte) 0);
  }
  // SHA-1 appends the length of the message in bits after the
  // padding block (above). Here length is in bytes. Multiply by
  // 8 by shifting by 3 as part of storing the 64 bit byte length
  // into the two words expected in the trailer.
  NB.encodeInt32(buffer, 56, (int) (length >>> (32 - 3)));
  NB.encodeInt32(buffer, 60, (int) (length << 3));
  compress(buffer, 0);
  if (foundCollision) {
    ObjectId id = h.toObjectId();
    LOG.warn("possible SHA-1 collision " + id.name()); //$NON-NLS-1$
    throw new Sha1CollisionException(id);
  }
}
origin: berlam/github-bucket

private SHA1() {
  h.init();
}
origin: berlam/github-bucket

final void init() {
  // Magic initialization constants defined by FIPS180.
  save(0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0);
}
origin: berlam/github-bucket

/**
 * Finish the digest and return the resulting hash.
 * <p>
 * Once {@code digest()} is called, this instance should be discarded.
 *
 * @return the ObjectId for the resulting hash.
 * @throws org.eclipse.jgit.util.sha1.Sha1CollisionException
 *             if a collision was detected and safeHash is false.
 */
public ObjectId toObjectId() throws Sha1CollisionException {
  finish();
  return h.toObjectId();
}
origin: berlam/github-bucket

/**
 * Reset this instance to compute another hash.
 *
 * @return {@code this}.
 */
public SHA1 reset() {
  h.init();
  length = 0;
  foundCollision = false;
  return this;
}
origin: org.eclipse.jgit/org.eclipse.jgit

 d += s3(e, a, b, c,w[ 56]);  a = rotateLeft( a, 30);
 c += s3(d, e, a, b,w[ 57]);  e = rotateLeft( e, 30);
state58.save(a, b, c, d, e);
 b += s3(c, d, e, a,w[ 58]);  d = rotateLeft( d, 30);
 a += s3(b, c, d, e,w[ 59]);  c = rotateLeft( c, 30);
 b += s4(c, d, e, a,w[ 63]);  d = rotateLeft( d, 30);
 a += s4(b, c, d, e,w[ 64]);  c = rotateLeft( c, 30);
state65.save(a, b, c, d, e);
 e += s4(a, b, c, d,w[ 65]);  b = rotateLeft( b, 30);
 d += s4(e, a, b, c,w[ 66]);  a = rotateLeft( a, 30);
h.save(h.a + a, h.b + b, h.c + c, h.d + d, h.e + e);
origin: org.eclipse.jgit/org.eclipse.jgit

private SHA1() {
  h.init();
}
origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Finish the digest and return the resulting hash.
 * <p>
 * Once {@code digest()} is called, this instance should be discarded.
 *
 * @return the ObjectId for the resulting hash.
 * @throws org.eclipse.jgit.util.sha1.Sha1CollisionException
 *             if a collision was detected and safeHash is false.
 */
public ObjectId toObjectId() throws Sha1CollisionException {
  finish();
  return h.toObjectId();
}
origin: org.eclipse.jgit/org.eclipse.jgit

final void init() {
  // Magic initialization constants defined by FIPS180.
  save(0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0);
}
origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Reset this instance to compute another hash.
 *
 * @return {@code this}.
 */
public SHA1 reset() {
  h.init();
  length = 0;
  foundCollision = false;
  return this;
}
org.eclipse.jgit.util.sha1SHA1$State

Most used methods

  • init
  • save
  • toObjectId

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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