Search in sources :

Example 1 with EciesAeadDemParams

use of com.google.crypto.tink.proto.EciesAeadDemParams in project tink by google.

the class EciesAeadHkdfPrivateKeyManager method createParams.

/**
 * @return a {@link EciesAeadHkdfParams} with the specified parameters.
 */
static EciesAeadHkdfParams createParams(EllipticCurveType curve, HashType hashType, EcPointFormat ecPointFormat, KeyTemplate demKeyTemplate, byte[] salt) {
    EciesHkdfKemParams kemParams = EciesHkdfKemParams.newBuilder().setCurveType(curve).setHkdfHashType(hashType).setHkdfSalt(ByteString.copyFrom(salt)).build();
    com.google.crypto.tink.proto.KeyTemplate protoKt = com.google.crypto.tink.proto.KeyTemplate.newBuilder().setTypeUrl(demKeyTemplate.getTypeUrl()).setValue(ByteString.copyFrom(demKeyTemplate.getValue())).setOutputPrefixType(toProto(demKeyTemplate.getOutputPrefixType())).build();
    EciesAeadDemParams demParams = EciesAeadDemParams.newBuilder().setAeadDem(protoKt).build();
    return EciesAeadHkdfParams.newBuilder().setKemParams(kemParams).setDemParams(demParams).setEcPointFormat(ecPointFormat).build();
}
Also used : EciesAeadDemParams(com.google.crypto.tink.proto.EciesAeadDemParams) EciesHkdfKemParams(com.google.crypto.tink.proto.EciesHkdfKemParams)

Example 2 with EciesAeadDemParams

use of com.google.crypto.tink.proto.EciesAeadDemParams in project tink by google.

the class HybridKeyTemplates method createEciesAeadHkdfParams.

/**
 * @return a {@link EciesAeadHkdfParams} with the specified parameters.
 */
public static EciesAeadHkdfParams createEciesAeadHkdfParams(EllipticCurveType curve, HashType hashType, EcPointFormat ecPointFormat, KeyTemplate demKeyTemplate, byte[] salt) {
    EciesHkdfKemParams kemParams = EciesHkdfKemParams.newBuilder().setCurveType(curve).setHkdfHashType(hashType).setHkdfSalt(ByteString.copyFrom(salt)).build();
    EciesAeadDemParams demParams = EciesAeadDemParams.newBuilder().setAeadDem(demKeyTemplate).build();
    return EciesAeadHkdfParams.newBuilder().setKemParams(kemParams).setDemParams(demParams).setEcPointFormat(ecPointFormat).build();
}
Also used : EciesAeadDemParams(com.google.crypto.tink.proto.EciesAeadDemParams) EciesHkdfKemParams(com.google.crypto.tink.proto.EciesHkdfKemParams)

Example 3 with EciesAeadDemParams

use of com.google.crypto.tink.proto.EciesAeadDemParams in project tink by google.

the class EciesAeadHkdfPublicKeyManagerTest method createKeyFormat.

private EciesAeadHkdfKeyFormat createKeyFormat(EllipticCurveType curve, HashType hashType, EcPointFormat ecPointFormat, KeyTemplate demKeyTemplate, byte[] salt) {
    EciesHkdfKemParams kemParams = EciesHkdfKemParams.newBuilder().setCurveType(curve).setHkdfHashType(hashType).setHkdfSalt(ByteString.copyFrom(salt)).build();
    EciesAeadDemParams demParams = EciesAeadDemParams.newBuilder().setAeadDem(demKeyTemplate).build();
    EciesAeadHkdfParams params = EciesAeadHkdfParams.newBuilder().setKemParams(kemParams).setDemParams(demParams).setEcPointFormat(ecPointFormat).build();
    return EciesAeadHkdfKeyFormat.newBuilder().setParams(params).build();
}
Also used : EciesAeadHkdfParams(com.google.crypto.tink.proto.EciesAeadHkdfParams) EciesAeadDemParams(com.google.crypto.tink.proto.EciesAeadDemParams) EciesHkdfKemParams(com.google.crypto.tink.proto.EciesHkdfKemParams)

Aggregations

EciesAeadDemParams (com.google.crypto.tink.proto.EciesAeadDemParams)3 EciesHkdfKemParams (com.google.crypto.tink.proto.EciesHkdfKemParams)3 EciesAeadHkdfParams (com.google.crypto.tink.proto.EciesAeadHkdfParams)1