what-the-bank/sources/org/bouncycastle/pqc/asn1/SPHINCS256KeyParams.java

48 lines
1.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.pqc.asn1;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
/* loaded from: classes6.dex */
public class SPHINCS256KeyParams extends ASN1Object {
private final AlgorithmIdentifier treeDigest;
private final ASN1Integer version;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.version);
aSN1EncodableVector.add(this.treeDigest);
return new DERSequence(aSN1EncodableVector);
}
public AlgorithmIdentifier getTreeDigest() {
return this.treeDigest;
}
public static final SPHINCS256KeyParams getInstance(Object obj) {
if (obj instanceof SPHINCS256KeyParams) {
return (SPHINCS256KeyParams) obj;
}
if (obj != null) {
return new SPHINCS256KeyParams(ASN1Sequence.getInstance(obj));
}
return null;
}
public SPHINCS256KeyParams(AlgorithmIdentifier algorithmIdentifier) {
this.version = new ASN1Integer(0L);
this.treeDigest = algorithmIdentifier;
}
private SPHINCS256KeyParams(ASN1Sequence aSN1Sequence) {
this.version = ASN1Integer.getInstance(aSN1Sequence.getObjectAt(0));
this.treeDigest = AlgorithmIdentifier.getInstance(aSN1Sequence.getObjectAt(1));
}
}