Add project

Basic formatting applied. Unnecessary comments have been removed. Suspicious code is covered by TODO.
This commit is contained in:
2025-08-12 11:21:10 +09:00
parent bbcbe841a7
commit 33ab055b43
546 changed files with 176950 additions and 0 deletions

View File

@ -0,0 +1,46 @@
using GostCryptography.Properties;
namespace GostCryptography.Asn1.Ber
{
public class Asn1CharRange : Asn1CharSet
{
private readonly int _lower;
private readonly int _upper;
public Asn1CharRange(int lower, int upper)
: base((upper - lower) + 1)
{
_lower = lower;
_upper = upper;
}
public override int MaxValue
{
get { return _upper; }
}
public override int GetCharAtIndex(int index)
{
index += _lower;
if (index > _upper)
{
throw ExceptionUtility.CryptographicException(Resources.Asn1ConsVioException, "Character index", index);
}
return index;
}
public override int GetCharIndex(int charValue)
{
var num = charValue - _lower;
if (num < 0)
{
throw ExceptionUtility.CryptographicException(Resources.Asn1ConsVioException, "Character index", charValue);
}
return num;
}
}
}