diff --git a/README.md b/README.md index dfb3aefc0938c691b8dbd7a087c09adf8facec8a..3dc188bac9c717d1d22ccd4c652874d9475e7e29 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,9 @@ two operations: ciphertext * `decrypt(ciphertext, associated_data)`, which decrypts the given `ciphertext` (using `associated_data` as additional AEAD-input) and returns the resulting - Â plaintext + ciphertext -Currently Tink already provides primitives for several common cryptographic +Currently Tink already provides primitives for several common crryptographic operations (like symmetric encryption, message authentication codes, digital signatures, hybrid encryption), and additional primitives are in preparation. Moreover, adding new primitives or adding custom implementations of existing @@ -34,7 +34,7 @@ The basic use of Tink proceeds in three steps: 1. Load or generate the cryptographic key material. 2. Use the key material to get an instance of a primitive. -3. Use the primitive to accomplish the cryptographic task. +3. Use the primitive to acomplish the cryptographic task. To be more concrete, here is how these steps would look like to perform symmetric encryption (AEAD) in a Java program: @@ -83,7 +83,7 @@ primitive: Before a specific implementation of a primitive can be used the Tink library must be the initialized so that it "knows" the desired implementations. This -initialization happens via _registration_ of the implementations. For +intialization happens via _registration_ of the implementations. For example if one would like to use the standard implementations of AEAD and MAC primitives offered by Tink, the initialization would look as follows: @@ -101,7 +101,7 @@ Now that you already know how to use Tink (it is really that simple!), you can proceed with using it in your code. Alternatively, you can continue reading the sections below to get more information about the library: its features, security, structure, extensibility, and more. To get direct instructions on how -to accomplish certain tasks with Tink +to acomplish certain tasks with Tink see [Java HOW-TO](https://github.com/google/tink/blob/master/doc/JAVA-HOWTO.md). ## Tink overview @@ -131,7 +131,7 @@ data and DEK, use the KMS to decrypt DEK, and use decrypted DEK to decrypt the data. **Key Management** In addition to cryptographic operations Tink provides also -support for key management features like key versioning, key rotation, storing +support for key management featuers like key versioning, key rotation, storing and loading keys from key management systems, and more. For example, if a cryptographic scheme is found broken, one can switch to a new implementation of the primitive by rotating the key without changing or recompiling code. @@ -212,7 +212,7 @@ type. To take advantage of key rotation and other key management features, a Tink user works usually not with single keys, but with **keysets**, which are just sets of keys with some additional parameters and metadata. In particular, this extra -information in the keyset determines which key is _primary_ (i.e. will be used to +information in the keyset dermines which key is _primary_ (i.e. will be used to create new cryptographic data like ciphertexts, or signatures), which keys are _enabled_ (i.e. can be used to process existing cryptographic data, like decrypt ciphertext or verify signatures), and which keys should not be used any more. diff --git a/java/src/main/java/com/google/cloud/crypto/tink/PrimitiveSet.java b/java/src/main/java/com/google/cloud/crypto/tink/PrimitiveSet.java index 247da61c2f6370cb3cbf5c2976d9c9787ad5dd81..5cd93b79a1488c55f6be345505764b80ffe3d9ae 100644 --- a/java/src/main/java/com/google/cloud/crypto/tink/PrimitiveSet.java +++ b/java/src/main/java/com/google/cloud/crypto/tink/PrimitiveSet.java @@ -35,7 +35,7 @@ import java.util.concurrent.ConcurrentMap; * PrimitiveSet is an auxiliary class used for supporting key rotation: primitives in a set * correspond to keys in a keyset. Users will usually work with primitive instances, * which essentially wrap primitive sets. For example an instance of an Aead-primitive - * for a given keyset holds a set of Aead-primitives corresponding to the keys in the keyset, + * for a given keyset holds a set of Aead-primitivies corresponding to the keys in the keyset, * and uses the set members to do the actual crypto operations: to encrypt data the primary * Aead-primitive from the set is used, and upon decryption the ciphertext's prefix * determines the id of the primitive from the set. <p> diff --git a/java/src/main/java/com/google/cloud/crypto/tink/subtle/Ed25519.java b/java/src/main/java/com/google/cloud/crypto/tink/subtle/Ed25519.java index 6b9b1154f2f4fbdbd790e90949a85a6f7f09091f..a2d649abc4f492b198e2fa22307e5ca7e135e29b 100644 --- a/java/src/main/java/com/google/cloud/crypto/tink/subtle/Ed25519.java +++ b/java/src/main/java/com/google/cloud/crypto/tink/subtle/Ed25519.java @@ -538,6 +538,7 @@ public final class Ed25519 { * Preconditions: * a[31] <= 127 */ + @SuppressWarnings("NarrowingCompoundAssignment") private static XYZ scalarMult(byte[] a) { byte[] e = new byte[2 * FIELD_LEN]; for (int i = 0; i < FIELD_LEN; i++) { @@ -601,8 +602,8 @@ public final class Ed25519 { return scalarMult(a).toBytes(); } + @SuppressWarnings("NarrowingCompoundAssignment") private static byte[] slide(byte[] a) { - byte[] r = new byte[256]; // Writes each bit in a[0..31] into r[0..255]: // a = a[0]+256*a[1]+...+256^31*a[31] is equal to diff --git a/java/src/main/java/com/google/cloud/crypto/tink/subtle/Ed25519Constants.java b/java/src/main/java/com/google/cloud/crypto/tink/subtle/Ed25519Constants.java index d347f307b85abe0b98d65df5b0ac21d10e673837..4284f3eb6d3d8a6cefe87ce1a8bcae01ff09be56 100644 --- a/java/src/main/java/com/google/cloud/crypto/tink/subtle/Ed25519Constants.java +++ b/java/src/main/java/com/google/cloud/crypto/tink/subtle/Ed25519Constants.java @@ -16,7 +16,7 @@ package com.google.cloud.crypto.tink.subtle; -import static com.google.cloud.crypto.tink.subtle.Ed25519.CachedXYT; +import com.google.cloud.crypto.tink.subtle.Ed25519.CachedXYT; /** * Constants used in {@link Ed25519}.