Skip to content

Commit 241ce84

Browse files
Change package name and move native files (#1174)
The package for the supporting classes that invoke the native library is changed from com.ibm.crypto.plus.provider.ock to com.ibm.crypto.plus.provider.base, since the same classes can be used to invoke functionality from other libraries in the future. The native files pertaining to OCKC functionality are moved to a newly created subdirectory (i.e., they are now under 'native/ock/' instead of just 'native/'). The makefiles and pom.xml are updated to account for these changes. Signed-off-by: Kostas Tsiounis <kostas.tsiounis@ibm.com>
1 parent d97d404 commit 241ce84

File tree

138 files changed

+658
-658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+658
-658
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
###############################################################################
22
#
3-
# Copyright IBM Corp. 2023
3+
# Copyright IBM Corp. 2023, 2026
44
#
55
# This code is free software; you can redistribute it and/or modify it
66
# under the terms provided by IBM in the LICENSE file that accompanied
@@ -38,7 +38,7 @@
3838
.vscode
3939

4040
# Dynamically generated header files produced by the build
41-
/src/main/native/com_ibm_crypto_plus_provider_ock_*.h
41+
/src/main/native/ock/com_ibm_crypto_plus_provider_base_*.h
4242

4343
# Files generated by tests.
4444
/0Test*.txt

buildNative.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
###############################################################################
44
#
5-
# Copyright IBM Corp. 2023
5+
# Copyright IBM Corp. 2023, 2026
66
#
77
# This code is free software; you can redistribute it and/or modify it
88
# under the terms provided by IBM in the LICENSE file that accompanied
@@ -51,7 +51,7 @@ if [ ${PLATFORM} == "ppc-aix64" ];
5151
then
5252
make=gmake
5353
fi
54-
cd src/main/native
54+
cd src/main/native/ock
5555

5656
${make} -f jgskit.mak clean
5757
${make} -f jgskit.mak

buildNativeMac.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
###############################################################################
44
#
5-
# Copyright IBM Corp. 2023
5+
# Copyright IBM Corp. 2023, 2026
66
#
77
# This code is free software; you can redistribute it and/or modify it
88
# under the terms provided by IBM in the LICENSE file that accompanied
@@ -21,7 +21,7 @@ if [ -z "$GSKIT_HOME" ];
2121
exit;
2222
fi
2323

24-
cd src/main/native
24+
cd src/main/native/ock
2525

2626
make -f jgskit.mac.mak clean
2727
make -f jgskit.mac.mak

buildNativeWin64.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
::#############################################################################
22
::#
3-
::# Copyright IBM Corp. 2023
3+
::# Copyright IBM Corp. 2023, 2026
44
::#
55
::# This code is free software; you can redistribute it and/or modify it
66
::# under the terms provided by IBM in the LICENSE file that accompanied
@@ -31,7 +31,7 @@ IF NOT DEFINED GSKIT_HOME (
3131

3232
:: @call "%VCVARS_64_SCRIPT%"
3333

34-
cd src/main/native
34+
cd src/main/native/ock
3535

3636
@call nmake -nologo -f jgskit.win64.cygwin.mak clean
3737
@call nmake -nologo -f jgskit.win64.cygwin.mak

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@
338338
--add-exports=java.base/sun.security.pkcs=ALL-UNNAMED
339339
--add-exports=java.base/sun.security.util=ALL-UNNAMED
340340
--add-exports=java.base/sun.security.x509=ALL-UNNAMED
341-
--add-exports openjceplus/com.ibm.crypto.plus.provider.ock=ALL-UNNAMED
341+
--add-exports openjceplus/com.ibm.crypto.plus.provider.base=ALL-UNNAMED
342342
</argLine>
343343
<includes>
344344
<include>
@@ -498,7 +498,7 @@
498498
still be explicitly exported for compilation to pass.
499499
-->
500500
<arg>--add-exports </arg>
501-
<arg>openjceplus/com.ibm.crypto.plus.provider.ock=ALL-UNNAMED</arg>
501+
<arg>openjceplus/com.ibm.crypto.plus.provider.base=ALL-UNNAMED</arg>
502502
<arg>--add-exports </arg>
503503
<arg>java.base/sun.util.logging=ALL-UNNAMED</arg>
504504
<arg>--add-exports </arg>

src/main/java/com/ibm/crypto/plus/provider/AESCCMCipher.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright IBM Corp. 2023, 2025
2+
* Copyright IBM Corp. 2023, 2026
33
*
44
* This code is free software; you can redistribute it and/or modify it
55
* under the terms provided by IBM in the LICENSE file that accompanied
@@ -8,8 +8,8 @@
88

99
package com.ibm.crypto.plus.provider;
1010

11-
import com.ibm.crypto.plus.provider.ock.CCMCipher;
12-
import com.ibm.crypto.plus.provider.ock.OCKContext;
11+
import com.ibm.crypto.plus.provider.base.CCMCipher;
12+
import com.ibm.crypto.plus.provider.base.OCKContext;
1313
import ibm.security.internal.spec.CCMParameterSpec;
1414
import java.math.BigInteger;
1515
import java.nio.ByteBuffer;
@@ -312,7 +312,7 @@ protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[]
312312
ShortBufferException sbe = new ShortBufferException(ock_sbe.getMessage());
313313
provider.setOCKExceptionCause(sbe, ock_sbe);
314314
throw sbe;
315-
} catch (com.ibm.crypto.plus.provider.ock.OCKException ock_excp) {
315+
} catch (com.ibm.crypto.plus.provider.base.OCKException ock_excp) {
316316
requireReinit = true;
317317
AEADBadTagException tagexcp = new AEADBadTagException(ock_excp.getMessage());
318318
provider.setOCKExceptionCause(tagexcp, ock_excp);

src/main/java/com/ibm/crypto/plus/provider/AESCipher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright IBM Corp. 2023, 2025
2+
* Copyright IBM Corp. 2023, 2026
33
*
44
* This code is free software; you can redistribute it and/or modify it
55
* under the terms provided by IBM in the LICENSE file that accompanied
@@ -8,8 +8,8 @@
88

99
package com.ibm.crypto.plus.provider;
1010

11-
import com.ibm.crypto.plus.provider.ock.Padding;
12-
import com.ibm.crypto.plus.provider.ock.SymmetricCipher;
11+
import com.ibm.crypto.plus.provider.base.Padding;
12+
import com.ibm.crypto.plus.provider.base.SymmetricCipher;
1313
import java.security.AlgorithmParameters;
1414
import java.security.InvalidAlgorithmParameterException;
1515
import java.security.InvalidKeyException;

src/main/java/com/ibm/crypto/plus/provider/AESGCMCipher.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright IBM Corp. 2023, 2025
2+
* Copyright IBM Corp. 2023, 2026
33
*
44
* This code is free software; you can redistribute it and/or modify it
55
* under the terms provided by IBM in the LICENSE file that accompanied
@@ -8,9 +8,9 @@
88

99
package com.ibm.crypto.plus.provider;
1010

11-
import com.ibm.crypto.plus.provider.ock.GCMCipher;
12-
import com.ibm.crypto.plus.provider.ock.OCKContext;
13-
import com.ibm.crypto.plus.provider.ock.OCKException;
11+
import com.ibm.crypto.plus.provider.base.GCMCipher;
12+
import com.ibm.crypto.plus.provider.base.OCKContext;
13+
import com.ibm.crypto.plus.provider.base.OCKException;
1414
import java.math.BigInteger;
1515
import java.nio.ByteBuffer;
1616
import java.security.AlgorithmParameters;
@@ -380,7 +380,7 @@ protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[]
380380
ShortBufferException sbe = new ShortBufferException(ock_sbe.getMessage());
381381
provider.setOCKExceptionCause(sbe, ock_sbe);
382382
throw sbe;
383-
} catch (com.ibm.crypto.plus.provider.ock.OCKException ock_excp) {
383+
} catch (com.ibm.crypto.plus.provider.base.OCKException ock_excp) {
384384
resetVars(true);
385385
AEADBadTagException tagexcp = new AEADBadTagException(ock_excp.getMessage());
386386
provider.setOCKExceptionCause(tagexcp, ock_excp);
@@ -1147,7 +1147,7 @@ protected int doUpdate(byte[] input, int inputOffset, int inputLen, byte[] outpu
11471147
ShortBufferException sbe = new ShortBufferException(ock_sbe.getMessage());
11481148
provider.setOCKExceptionCause(sbe, ock_sbe);
11491149
throw sbe;
1150-
} catch (com.ibm.crypto.plus.provider.ock.OCKException ock_excp) {
1150+
} catch (com.ibm.crypto.plus.provider.base.OCKException ock_excp) {
11511151
sbeInLastUpdateEncrypt = false;
11521152
AEADBadTagException tagexcp = new AEADBadTagException(ock_excp.getMessage());
11531153
provider.setOCKExceptionCause(tagexcp, ock_excp);

src/main/java/com/ibm/crypto/plus/provider/AESKeyWrapCipher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright IBM Corp. 2025
2+
* Copyright IBM Corp. 2026
33
*
44
* This code is free software; you can redistribute it and/or modify it
55
* under the terms provided by IBM in the LICENSE file that accompanied
@@ -8,8 +8,8 @@
88

99
package com.ibm.crypto.plus.provider;
1010

11-
import com.ibm.crypto.plus.provider.ock.AESKeyWrap;
12-
import com.ibm.crypto.plus.provider.ock.OCKException;
11+
import com.ibm.crypto.plus.provider.base.AESKeyWrap;
12+
import com.ibm.crypto.plus.provider.base.OCKException;
1313
import java.security.AlgorithmParameters;
1414
import java.security.InvalidAlgorithmParameterException;
1515
import java.security.InvalidKeyException;

src/main/java/com/ibm/crypto/plus/provider/ChaCha20Cipher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright IBM Corp. 2023, 2025
2+
* Copyright IBM Corp. 2023, 2026
33
*
44
* This code is free software; you can redistribute it and/or modify it
55
* under the terms provided by IBM in the LICENSE file that accompanied
@@ -8,8 +8,8 @@
88

99
package com.ibm.crypto.plus.provider;
1010

11-
import com.ibm.crypto.plus.provider.ock.Padding;
12-
import com.ibm.crypto.plus.provider.ock.SymmetricCipher;
11+
import com.ibm.crypto.plus.provider.base.Padding;
12+
import com.ibm.crypto.plus.provider.base.SymmetricCipher;
1313
import java.nio.ByteBuffer;
1414
import java.nio.ByteOrder;
1515
import java.security.AlgorithmParameters;

0 commit comments

Comments
 (0)