1c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// Copyright (c) 2009 The Chromium Authors. All rights reserved. 2c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// Use of this source code is governed by a BSD-style license that can be 3c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// found in the LICENSE file. 4c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 5c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#ifndef NET_HTTP_DES_H_ 6c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#define NET_HTTP_DES_H_ 7c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 8c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "base/basictypes.h" 9c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 10c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottnamespace net { 11c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 12c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott//----------------------------------------------------------------------------- 13c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// DES support code for NTLM authentication. 14c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// 15c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// TODO(wtc): Turn this into a C++ API and move it to the base module. 16c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 17c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// Build a 64-bit DES key from a 56-bit raw key. 18c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottvoid DESMakeKey(const uint8* raw, uint8* key); 19c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 20c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// Run the DES encryption algorithm in ECB mode on one block (8 bytes) of 21c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// data. |key| is a DES key (8 bytes), |src| is the input plaintext (8 22c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// bytes), and |hash| is an 8-byte buffer receiving the output ciphertext. 23c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottvoid DESEncrypt(const uint8* key, const uint8* src, uint8* hash); 24c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 25c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott} // namespace net 26c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 27c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#endif // NET_HTTP_DES_H_ 28