aiken/crypto/int224
This module implements arithmetic operations in a constrained 224-bit integer field. Operations are performed modulo , providing a field for cryptographic operations that require 28-byte values.
The module provides functionality for basic arithmetic operations (addition, subtraction, multiplication) within this constrained field, as well as conversion functions between different representations.
Types
Alias
State = bitwise.State<Bits224>Constants
Functions
Constructing
      
  
  
  
      
        
        Constructs a new Bits224 element from a Big-Endian (most-significant bits first) ByteArray.
      
    
  
  
      
        
        Constructs a new Bits224 element from a Little-Endian (least-significant bits first) ByteArray.
      
    
  
  
      
        
        Constructs a new Bits224 element from an integer, ensuring it’s within the valid range of the field.
      
    
  
  
      
        Modifying
      
  
  
  
      
        
        Exponentiates a Bits224 element by a non-negative integer exponent, using repeated squaring.
Note that this function returns zero for negative exponents.
      
    
  
  
      
        
        A faster version of scale for the case where the exponent is a power of two.
That is, the exponent  for some non-negative integer .
      
    
  
  
      
        Combining
      
  
  
  
      
        
        Adds two Bits224 elements, ensuring the result stays within the finite field range.
      
    
  
  
      
        
        Adds a ByteArray to a Bits224 element, interpreting bytes as a big-endian number.
      
    
  
  
      
    
  
  
      
        
        Multiplies two Bits224 elements, with the result constrained within the finite field.
      
    
  
  
      
        
        Multiplies a Bits224 element by a ByteArray, interpreting bytes as a big-endian number.
      
    
  
  
      
    
  
  
      
    
  
  
      
        
        Subtracts one Bits224 element from another, with the result wrapped within the finite field range.
      
    
  
  
      
        
        Subtracts a ByteArray from a Bits224 element, interpreting bytes as a big-endian number.
      
    
  
  
      
    
  
  
      
        Transforming
      
  
  
  
      
        
        Converts a Bits224 element to a Big-Endian (most-significant bits first) ByteArray.
      
    
  
  
      
        
        Converts a Bits224 element to a Little-Endian (least-significant bits first) ByteArray.
      
    
  
  
      
    
  
Constructs a new Bits224 element from a Big-Endian (most-significant bits first) ByteArray.
Constructs a new Bits224 element from a Little-Endian (least-significant bits first) ByteArray.
Constructs a new Bits224 element from an integer, ensuring it’s within the valid range of the field.
Exponentiates a Bits224 element by a non-negative integer exponent, using repeated squaring.
Note that this function returns zero for negative exponents.
A faster version of scale for the case where the exponent is a power of two.
That is, the exponent  for some non-negative integer .
Combining
      
  
  
  
      
        
        Adds two Bits224 elements, ensuring the result stays within the finite field range.
      
    
  
  
      
        
        Adds a ByteArray to a Bits224 element, interpreting bytes as a big-endian number.
      
    
  
  
      
    
  
  
      
        
        Multiplies two Bits224 elements, with the result constrained within the finite field.
      
    
  
  
      
        
        Multiplies a Bits224 element by a ByteArray, interpreting bytes as a big-endian number.
      
    
  
  
      
    
  
  
      
    
  
  
      
        
        Subtracts one Bits224 element from another, with the result wrapped within the finite field range.
      
    
  
  
      
        
        Subtracts a ByteArray from a Bits224 element, interpreting bytes as a big-endian number.
      
    
  
  
      
    
  
  
      
        Transforming
      
  
  
  
      
        
        Converts a Bits224 element to a Big-Endian (most-significant bits first) ByteArray.
      
    
  
  
      
        
        Converts a Bits224 element to a Little-Endian (least-significant bits first) ByteArray.
      
    
  
  
      
    
  
Adds two Bits224 elements, ensuring the result stays within the finite field range.
Adds a ByteArray to a Bits224 element, interpreting bytes as a big-endian number.
Multiplies two Bits224 elements, with the result constrained within the finite field.
Multiplies a Bits224 element by a ByteArray, interpreting bytes as a big-endian number.
Subtracts one Bits224 element from another, with the result wrapped within the finite field range.
Subtracts a ByteArray from a Bits224 element, interpreting bytes as a big-endian number.
Converts a Bits224 element to a Big-Endian (most-significant bits first) ByteArray.
Converts a Bits224 element to a Little-Endian (least-significant bits first) ByteArray.