xref: /illumos-gate/usr/src/lib/pkcs11/libsoftcrypto/Makefile.com (revision 8a2b682e57a046b828f37bcde1776f131ef4629f)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
24# Copyright 2017 Jason King.
25# Copyright (c) 2018, Joyent, Inc.
26#
27
28# AES
29AES_DIR =		$(SRC)/common/crypto/aes
30AES_COMMON_OBJS =	aes_impl.o aes_modes.o
31AES_COMMON_SRC =	$(AES_COMMON_OBJS:%.o=$(AES_DIR)/%.c)
32AES_FLAGS =		-I$(AES_DIR)
33
34# Blowfish
35BLOWFISH_DIR =		$(SRC)/common/crypto/blowfish
36BLOWFISH_COMMON_OBJS =	blowfish_impl.o
37BLOWFISH_COMMON_SRC =	$(BLOWFISH_COMMON_OBJS:%.o=$(BLOWFISH_DIR)/%.c)
38BLOWFISH_FLAGS =	-I$(BLOWFISH_DIR)
39
40# ARCFour
41ARCFOUR_DIR =		$(SRC)/common/crypto/arcfour
42ARCFOUR_COMMON_OBJS =	arcfour_crypt.o
43ARCFOUR_COMMON_SRC =	$(ARCFOUR_COMMON_OBJS:%.o=$(ARCFOUR_DIR)/%.c)
44ARCFOUR_FLAGS =		-I$(ARCFOUR_DIR)
45
46# DES
47DES_DIR =		$(SRC)/common/crypto/des
48DES_COMMON_OBJS =	des_impl.o des_ks.o
49DES_COMMON_SRC =	$(DES_COMMON_OBJS:%.o=$(DES_DIR)/%.c)
50DES_FLAGS =		-I$(DES_DIR)
51
52# BIGNUM -- needed by DH, DSA, RSA
53BIGNUM_DIR =		$(SRC)/common/bignum
54BIGNUM_COMMON_OBJS =	bignumimpl.o
55BIGNUM_COMMON_SRC =	$(BIGNUM_COMMON_OBJS:%.o=$(BIGNUM_DIR)/%.c)
56BIGNUM_FLAGS =		-I$(BIGNUM_DIR)
57
58# Modes
59MODES_DIR =		$(SRC)/common/crypto/modes
60MODES_COMMON_OBJS =	modes.o ecb.o cbc.o ctr.o ccm.o gcm.o
61MODES_COMMON_SRC =	$(MODES_COMMON_OBJS:%.o=$(MODES_DIR)/%.c)
62MODES_FLAGS =		-I$(MODES_DIR)
63
64# DH
65DH_DIR =		$(SRC)/common/crypto/dh
66DH_COMMON_OBJS =	dh_impl.o
67DH_COMMON_SRC =		$(DH_COMMON_OBJS:%.o=$(DH_DIR)/%.c)
68DH_FLAGS =		$(BIGNUM_FLAGS) -I$(DH_DIR)
69
70# DSA
71DSA_DIR =		$(SRC)/common/crypto/dsa
72DSA_COMMON_OBJS =	dsa_impl.o
73DSA_COMMON_SRC =	$(DSA_COMMON_OBJS:%.o=$(DSA_DIR)/%.c)
74DSA_FLAGS =		$(BIGNUM_FLAGS) -I$(DSA_DIR)
75
76# RSA
77RSA_DIR =		$(SRC)/common/crypto/rsa
78RSA_COMMON_OBJS =	rsa_impl.o
79RSA_COMMON_SRC =	$(RSA_COMMON_OBJS:%.o=$(RSA_DIR)/%.c)
80RSA_FLAGS =		$(BIGNUM_FLAGS) -I$(RSA_DIR)
81
82# PADDING -- needed by RSA
83PAD_DIR =		$(SRC)/common/crypto/padding
84PAD_COMMON_OBJS =	pkcs1.o pkcs7.o
85PAD_COMMON_SRC =	$(PAD_COMMON_OBJS:%.o=$(PAD_DIR)/%.c)
86PAD_FLAGS =		-I$(PAD_DIR)
87
88# Object setup
89AES_OBJS =		$(AES_COMMON_OBJS)	$(AES_PSM_OBJS)
90ARCFOUR_OBJS =		$(ARCFOUR_COMMON_OBJS)	$(ARCFOUR_PSM_OBJS)
91BLOWFISH_OBJS =		$(BLOWFISH_COMMON_OBJS)	$(BLOWFISH_PSM_OBJS)
92DES_OBJS =		$(DES_COMMON_OBJS)	$(DES_PSM_OBJS)
93BIGNUM_OBJS =		$(BIGNUM_COMMON_OBJS)	$(BIGNUM_PSM_OBJS)
94MODES_OBJS =		$(MODES_COMMON_OBJS)	$(MODES_PSM_OBJS)
95DH_OBJS =		$(DH_COMMON_OBJS)	$(DH_PSM_OBJS)
96DSA_OBJS =		$(DSA_COMMON_OBJS)	$(DSA_PSM_OBJS)
97RSA_OBJS =		$(RSA_COMMON_OBJS)	$(RSA_PSM_OBJS)
98PAD_OBJS =		$(PAD_COMMON_OBJS)	$(PAD_PSM_OBJS)
99
100OBJECTS =		$(AES_OBJS) $(ARCFOUR_OBJS) $(BIGNUM_OBJS) \
101			$(BLOWFISH_OBJS) $(DES_OBJS) $(MODES_OBJS) $(DH_OBJS) \
102			$(DSA_OBJS) $(RSA_OBJS) $(PAD_OBJS)
103
104# Source file setup
105AES_SRC =		$(AES_COMMON_SRC)	$(AES_PSM_SRC)
106ARCFOUR_SRC =		$(ARCFOUR_COMMON_SRC)	$(ARCFOUR_PSM_SRC)
107BLOWFISH_SRC =		$(BLOWFISH_COMMON_SRC)	$(BLOWFISH_PSM_SRC)
108DES_SRC =		$(DES_COMMON_SRC)	$(DES_PSM_SRC)
109BIGNUM_SRC =		$(BIGNUM_COMMON_SRC)	$(BIGNUM_PSM_SRC)
110MODES_SRC =		$(MODES_COMMON_SRC)	$(MODES_PSM_SRC)
111DH_SRC =		$(DH_COMMON_SRC)	$(DH_PSM_SRC)
112DSA_SRC =		$(DSA_COMMON_SRC)	$(DSA_PSM_SRC)
113RSA_SRC =		$(RSA_COMMON_SRC)	$(RSA_PSM_SRC)
114PAD_SRC =		$(PAD_COMMON_SRC)	$(PAD_PSM_SRC)
115
116# Header include directories
117CRYPTODIR =		$(SRC)/common/crypto
118UTSDIR =		$(SRC)/uts/common/
119
120# Lint
121EXTRA_LINT_FLAGS =	$(AES_FLAGS) $(BLOWFISH_FLAGS) $(ARCFOUR_FLAGS) \
122			$(DES_FLAGS) $(BIGNUM_FLAGS) $(MODES_FLAGS) \
123			$(DH_FLAGS) $(DSA_FLAGS) $(RSA_FLAGS) $(PAD_FLAGS)
124