/*
* Freescale SEC data structures for integration with ocf-linux
*
* Copyright (c) 2006 Freescale Semiconductor, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* paired descriptor and associated crypto operation
*/
struct desc_cryptop_pair {
struct talitos_desc cf_desc; /* descriptor ptr */
struct cryptop *cf_crp; /* cryptop ptr */
};
/*
* Holds data specific to a single talitos device.
*/
struct talitos_softc {
softc_device_decl sc_cdev;
struct platform_device *sc_dev; /* device backpointer */
ocf_iomem_t sc_base_addr;
int sc_irq;
int sc_num; /* if we have multiple chips */
int32_t sc_cid; /* crypto tag */
u64 sc_chiprev; /* major/minor chip revision */
int sc_nsessions;
struct talitos_session *sc_sessions;
int sc_num_channels;/* number of crypto channels */
int sc_chfifo_len; /* channel fetch fifo len */
int sc_exec_units; /* execution units mask */
int sc_desc_types; /* descriptor types mask */
/*
* mutual exclusion for intra-channel resources, e.g. fetch fifos
* the last entry is a meta-channel lock used by the channel scheduler
*/
spinlock_t *sc_chnfifolock;
/* sc_chnlastalgo contains last algorithm for that channel */
int *sc_chnlastalg;
/* sc_chnfifo holds pending descriptor--crypto operation pairs */
struct desc_cryptop_pair **sc_chnfifo;
};
struct talitos_session {
u_int32_t ses_used;
u_int32_t ses_klen; /* key length in bits */
u_int32_t ses_key[8]; /* DES/3DES/AES key */
u_int32_t ses_hmac[5]; /* hmac inner state */
u_int32_t ses_hmac_len; /* hmac length */
u_int32_t ses_mlen; /* desired hash result len (12=ipsec or 16) */
};
#define TALITOS_SESSION(sid) ((sid) & 0x0fffffff)
#define TALITOS_SID(crd, sesn) (((crd) << 28) | ((sesn) & 0x0fffffff))
f94c903cb060d42edb8cfe2badc15e'>root/lib/src/main/java/com/trilead/ssh2/compression/ICompressor.java
blob: a71d31b727b4e5ab31685c6d55b1c184f49b92e7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/*
ConnectBot: simple, powerful, open-source SSH client for Android
Copyright (C) 2007-2008 Kenny Root, Jeffrey Sharkey
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.trilead.ssh2.compression;
/**
* @author Kenny Root
*
*/
public interface ICompressor {
int getBufferSize();
int compress(byte[] buf, int start, int len, byte[] output);
byte[] uncompress(byte[] buf, int start, int[] len);
}
|