2362N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * MessageDigest implementation class. This class currently supports 0N/A * MD2, MD5, SHA-1, SHA-256, SHA-384, and SHA-512. 0N/A * Note that many digest operations are on fairly small amounts of data 0N/A * (less than 100 bytes total). For example, the 2nd hashing in HMAC or 0N/A * the PRF in TLS. In order to speed those up, we use some buffering to 0N/A * minimize number of the Java->native transitions. 0N/A * @author Andreas Sterbenz 0N/A /* unitialized, fields uninitialized, no session acquired */ 0N/A // data in buffer, all fields valid, session acquired 0N/A // but digest not initialized 0N/A /* session initialized for digesting */ 0N/A // length of the digest in bytes 0N/A // associated session, if any 0N/A // current state, one of S_* above 0N/A // one byte buffer for the update(byte) method, initialized on demand 0N/A // buffer to reduce number of JNI calls 0N/A // offset into the buffer 0N/A // need to explicitly "cancel" active op by finishing it 0N/A // Called by SunJSSE via reflection during the SSL 3.0 handshake if 0N/A // the master secret is sensitive. We may want to consider making this 0N/A // method public in a future release. 0N/A // SunJSSE calls this method only if the key does not have a RAW 0N/A // encoding, i.e. if it is sensitive. Therefore, no point in calling 0N/A // SecretKeyFactory to try to convert it. Just verify it ourselves.