Merge pull request #15 from place-labs/fix/aead-chalsa-signature
Fix `#encrypt_detached` for crystal 1.2.0
This commit is contained in:
		
						commit
						bbbbcbd856
					
				
					 3 changed files with 18 additions and 6 deletions
				
			
		
							
								
								
									
										20
									
								
								.github/workflows/crystal.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								.github/workflows/crystal.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -9,9 +9,23 @@ on: | ||||||
| jobs: | jobs: | ||||||
|   build: |   build: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|  |     name: "crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }}" | ||||||
|  |     continue-on-error: ${{ !matrix.stable }} | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         stable: [true] | ||||||
|  |         crystal: | ||||||
|  |           - 1.0.0 | ||||||
|  |           - 1.1.0 | ||||||
|  |           - 1.1.1 | ||||||
|  |           - 1.2.0 | ||||||
|  |         include: | ||||||
|  |           - crystal: nightly | ||||||
|  |             stable: false | ||||||
| 
 | 
 | ||||||
|     container: |     container: | ||||||
|       image: crystallang/crystal |       image: crystallang/crystal:${{ matrix.crystal }} | ||||||
| 
 | 
 | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v2 |     - uses: actions/checkout@v2 | ||||||
|  | @ -31,8 +45,7 @@ jobs: | ||||||
|     - name: Install dependencies |     - name: Install dependencies | ||||||
|       run: shards install |       run: shards install | ||||||
|     - name: Run tests |     - name: Run tests | ||||||
|       run: crystal spec -Dpreview_mt --order random  |       run: crystal spec -Dpreview_mt --order random | ||||||
| #      run: crystal spec -Dpreview_mt --order random --error-on-warnings |  | ||||||
|     - name: Run bulid |     - name: Run bulid | ||||||
|       run: shards build -Dpreview_mt |       run: shards build -Dpreview_mt | ||||||
|     - name: Run format |     - name: Run format | ||||||
|  | @ -40,4 +53,3 @@ jobs: | ||||||
|     - name: Failed |     - name: Failed | ||||||
|       if: ${{ failure() }} |       if: ${{ failure() }} | ||||||
|       run: "[ -f libsodium_install.out ] && cat libsodium_install.out" |       run: "[ -f libsodium_install.out ] && cat libsodium_install.out" | ||||||
| 
 |  | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ version: 1.2.3 | ||||||
| authors: | authors: | ||||||
| - Andrew Hamon <andrew@hamon.cc> | - Andrew Hamon <andrew@hamon.cc> | ||||||
| - Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> | - Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> | ||||||
| crystal: ">= 0.36.0" | crystal: ">= 1.0.0" | ||||||
| targets: | targets: | ||||||
|   blake2b_hash: |   blake2b_hash: | ||||||
|     main: examples/blake2b_hash.cr |     main: examples/blake2b_hash.cr | ||||||
|  |  | ||||||
|  | @ -103,7 +103,7 @@ module Sodium::Cipher::Aead | ||||||
|       # `src` and `dst` may be the same object but should not overlap. |       # `src` and `dst` may be the same object but should not overlap. | ||||||
|       # May supply `mac`, otherwise a new one is returned. |       # May supply `mac`, otherwise a new one is returned. | ||||||
|       # May supply `additional` |       # May supply `additional` | ||||||
|       def encrypt_detached(src : Bytes, dst : Bytes? = nil, nonce : Sodium::Nonce? = nil, *, mac : Bytes? = nil, additional : String | Bytes | Nil = nil) : {Bytes, Bytes, Sodium::Nonce} |       def encrypt_detached(src : Bytes, dst : Bytes? = nil, *, nonce : Sodium::Nonce? = nil, mac : Bytes? = nil, additional : String | Bytes | Nil = nil) : {Bytes, Bytes, Sodium::Nonce} | ||||||
|         dst ||= Bytes.new src.bytesize |         dst ||= Bytes.new src.bytesize | ||||||
|         nonce ||= Sodium::Nonce.random |         nonce ||= Sodium::Nonce.random | ||||||
|         mac ||= Bytes.new MAC_SIZE |         mac ||= Bytes.new MAC_SIZE | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 didactic-drunk
						didactic-drunk