41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59 #include <openssl/crypto.h>
60 #include <openssl/cast.h>
61 #include "cast_lcl.h"
62 #include "cast_s.h"
63
64 #define CAST_exp(l,A,a,n) \
65 A[n/4]=l; \
66 a[n+3]=(l )&0xff; \
67 a[n+2]=(l>> 8)&0xff; \
68 a[n+1]=(l>>16)&0xff; \
69 a[n+0]=(l>>24)&0xff;
70
71 #define S4 CAST_S_table4
72 #define S5 CAST_S_table5
73 #define S6 CAST_S_table6
74 #define S7 CAST_S_table7
75 void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data)
76 #ifdef OPENSSL_FIPS
77 {
78 fips_cipher_abort(CAST);
79 private_CAST_set_key(key, len, data);
80 }
81 void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data)
82 #endif
|
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59 #include <openssl/crypto.h>
60 #include <openssl/cast.h>
61 #include <cast_lcl.h>
62 #include <cast_s.h>
63
64 #define CAST_exp(l,A,a,n) \
65 A[n/4]=l; \
66 a[n+3]=(l )&0xff; \
67 a[n+2]=(l>> 8)&0xff; \
68 a[n+1]=(l>>16)&0xff; \
69 a[n+0]=(l>>24)&0xff;
70
71 #define S4 CAST_S_table4
72 #define S5 CAST_S_table5
73 #define S6 CAST_S_table6
74 #define S7 CAST_S_table7
75 void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data)
76 #ifdef OPENSSL_FIPS
77 {
78 fips_cipher_abort(CAST);
79 private_CAST_set_key(key, len, data);
80 }
81 void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data)
82 #endif
|