Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-tink
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-tink
Commits
5d5c95db
Commit
5d5c95db
authored
5 years ago
by
tholenst
Committed by
przydatek
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Mark MacJce with @Immutable.
PiperOrigin-RevId: 249644245
parent
23c15c3b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/main/java/com/google/crypto/tink/subtle/BUILD.bazel
+1
-0
1 addition, 0 deletions
java/src/main/java/com/google/crypto/tink/subtle/BUILD.bazel
java/src/main/java/com/google/crypto/tink/subtle/MacJce.java
+6
-1
6 additions, 1 deletion
java/src/main/java/com/google/crypto/tink/subtle/MacJce.java
with
7 additions
and
1 deletion
java/src/main/java/com/google/crypto/tink/subtle/BUILD.bazel
+
1
−
0
View file @
5d5c95db
...
...
@@ -88,6 +88,7 @@ java_library(
javacopts
=
JAVACOPTS_OSS
,
deps
=
[
"
:subtle
"
,
"
@com_google_errorprone_error_prone_annotations
"
,
"
//java/src/main/java/com/google/crypto/tink:primitives
"
,
"
//java/src/main/java/com/google/crypto/tink/annotations
"
,
],
...
...
This diff is collapsed.
Click to expand it.
java/src/main/java/com/google/crypto/tink/subtle/MacJce.java
+
6
−
1
View file @
5d5c95db
...
...
@@ -17,6 +17,7 @@
package
com.google.crypto.tink.subtle
;
import
com.google.crypto.tink.Mac
;
import
com.google.errorprone.annotations.Immutable
;
import
java.security.GeneralSecurityException
;
import
java.security.InvalidAlgorithmParameterException
;
import
java.security.NoSuchAlgorithmException
;
...
...
@@ -26,13 +27,17 @@ import java.security.NoSuchAlgorithmException;
*
* @since 1.0.0
*/
@Immutable
public
final
class
MacJce
implements
Mac
{
static
final
int
MIN_TAG_SIZE_IN_BYTES
=
10
;
static
final
int
MIN_KEY_SIZE_IN_BYTES
=
16
;
private
javax
.
crypto
.
Mac
mac
;
@SuppressWarnings
(
"Immutable"
)
// We do not mutate the underlying mac.
private
final
javax
.
crypto
.
Mac
mac
;
private
final
int
digestSize
;
private
final
String
algorithm
;
@SuppressWarnings
(
"Immutable"
)
// We do not mutate the key.
private
final
java
.
security
.
Key
key
;
public
MacJce
(
String
algorithm
,
java
.
security
.
Key
key
,
int
digestSize
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment