src/share/classes/java/security/MessageDigestSpi.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 29,39 ****
import sun.security.jca.JCAUtil;
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
! * for the <code>MessageDigest</code> class, which provides the functionality
* of a message digest algorithm, such as MD5 or SHA. Message digests are
* secure one-way hash functions that take arbitrary-sized data and output a
* fixed-length hash value.
*
* <p> All the abstract methods in this class must be implemented by a
--- 29,39 ----
import sun.security.jca.JCAUtil;
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
! * for the {@code MessageDigest} class, which provides the functionality
* of a message digest algorithm, such as MD5 or SHA. Message digests are
* secure one-way hash functions that take arbitrary-sized data and output a
* fixed-length hash value.
*
* <p> All the abstract methods in this class must be implemented by a
*** 86,103 ****
* @param input the array of bytes to use for the update.
*
* @param offset the offset to start from in the array of bytes.
*
* @param len the number of bytes to use, starting at
! * <code>offset</code>.
*/
protected abstract void engineUpdate(byte[] input, int offset, int len);
/**
* Update the digest using the specified ByteBuffer. The digest is
! * updated using the <code>input.remaining()</code> bytes starting
! * at <code>input.position()</code>.
* Upon return, the buffer's position will be equal to its limit;
* its limit will not have changed.
*
* @param input the ByteBuffer
* @since 1.5
--- 86,103 ----
* @param input the array of bytes to use for the update.
*
* @param offset the offset to start from in the array of bytes.
*
* @param len the number of bytes to use, starting at
! * {@code offset}.
*/
protected abstract void engineUpdate(byte[] input, int offset, int len);
/**
* Update the digest using the specified ByteBuffer. The digest is
! * updated using the {@code input.remaining()} bytes starting
! * at {@code input.position()}.
* Upon return, the buffer's position will be equal to its limit;
* its limit will not have changed.
*
* @param input the ByteBuffer
* @since 1.5
*** 128,138 ****
}
}
/**
* Completes the hash computation by performing final
! * operations such as padding. Once <code>engineDigest</code> has
* been called, the engine should be reset (see
* {@link #engineReset() engineReset}).
* Resetting is the responsibility of the
* engine implementor.
*
--- 128,138 ----
}
}
/**
* Completes the hash computation by performing final
! * operations such as padding. Once {@code engineDigest} has
* been called, the engine should be reset (see
* {@link #engineReset() engineReset}).
* Resetting is the responsibility of the
* engine implementor.
*
*** 140,150 ****
*/
protected abstract byte[] engineDigest();
/**
* Completes the hash computation by performing final
! * operations such as padding. Once <code>engineDigest</code> has
* been called, the engine should be reset (see
* {@link #engineReset() engineReset}).
* Resetting is the responsibility of the
* engine implementor.
*
--- 140,150 ----
*/
protected abstract byte[] engineDigest();
/**
* Completes the hash computation by performing final
! * operations such as padding. Once {@code engineDigest} has
* been called, the engine should be reset (see
* {@link #engineReset() engineReset}).
* Resetting is the responsibility of the
* engine implementor.
*
*** 192,202 ****
* Returns a clone if the implementation is cloneable.
*
* @return a clone if the implementation is cloneable.
*
* @exception CloneNotSupportedException if this is called on an
! * implementation that does not support <code>Cloneable</code>.
*/
public Object clone() throws CloneNotSupportedException {
if (this instanceof Cloneable) {
return super.clone();
} else {
--- 192,202 ----
* Returns a clone if the implementation is cloneable.
*
* @return a clone if the implementation is cloneable.
*
* @exception CloneNotSupportedException if this is called on an
! * implementation that does not support {@code Cloneable}.
*/
public Object clone() throws CloneNotSupportedException {
if (this instanceof Cloneable) {
return super.clone();
} else {